-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jonas Remmert <[email protected]>
- Loading branch information
Showing
7 changed files
with
1,381 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Build | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/zephyrproject-rtos/ci:v0.27.4 | ||
env: | ||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.17.0 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
path: waterlevel_monitor | ||
fetch-depth: 0 # Fetch all history including tags | ||
|
||
- name: Initialize | ||
working-directory: waterlevel_monitor | ||
run: | | ||
pip3 install -U west | ||
west init -l . | ||
west update --narrow | ||
pip3 install -r ../zephyr/scripts/requirements-base.txt | ||
- name: Twister Tests for fw_tests | ||
working-directory: waterlevel_monitor | ||
shell: bash | ||
run: | | ||
west twister -T fw_test -v --inline-logs --integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,68 @@ | ||
name: Build Sphinx Doc | ||
name: Compliance Checks | ||
|
||
on: | ||
pull_request: | ||
on: pull_request | ||
|
||
jobs: | ||
build-doc: | ||
check_compliance: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Update PATH for west | ||
run: | | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
- name: Checkout the code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: 0 | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: cache-pip | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-doc-pip | ||
|
||
- name: Install Packages | ||
- name: Install python dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install plantuml tox python3-pip -y | ||
pip3 install setuptools | ||
pip3 install wheel | ||
pip3 install python-magic junitparser gitlint pylint pykwalify | ||
- name: Build static site with Tox | ||
- name: Run Compliance Tests | ||
continue-on-error: true | ||
id: compliance | ||
env: | ||
BASE_REF: ${{ github.base_ref }} | ||
run: | | ||
cd doc | ||
tox -e py3-html | ||
# debug | ||
ls -la | ||
git log --pretty=oneline | head -n 10 | ||
./ci/check_compliance.py -m checkpatch -m Gitlint -c origin/${BASE_REF}.. | ||
- name: Deploy Preview | ||
uses: peaceiris/actions-gh-pages@v4 | ||
- name: upload-results | ||
uses: actions/upload-artifact@v3 | ||
continue-on-error: True | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: doc/build/html | ||
destination_dir: 'previews/${{ github.event.number }}' | ||
name: compliance.xml | ||
path: compliance.xml | ||
|
||
- name: Create status check with preview link | ||
- name: check-warns | ||
run: | | ||
PREVIEW_URL="https://flownexus-lwm2m.github.io/waterlevel_monitor/previews/${{ github.event.number }}" | ||
PAYLOAD=$(echo '{}' | jq --arg name 'Documentation Preview' --arg url "${PREVIEW_URL}" '{"name": $name, "head_sha": "${{ github.event.pull_request.head.sha }}", "details_url": $url, "status": "completed", "conclusion": "success", "output": {"title": $name, "summary": "Preview available at", "text": $url}}') | ||
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Content-Type: application/json" \ | ||
-X POST -d "${PAYLOAD}" \ | ||
"https://api.github.com/repos/${{ github.repository }}/check-runs" | ||
if [[ ! -s "compliance.xml" ]]; then | ||
exit 1; | ||
fi | ||
for file in Nits.txt checkpatch.txt Identity.txt Gitlint.txt pylint.txt Devicetree.txt Kconfig.txt; do | ||
if [[ -s $file ]]; then | ||
errors=$(cat $file) | ||
errors="${errors//'%'/'%25'}" | ||
errors="${errors//$'\n'/'%0A'}" | ||
errors="${errors//$'\r'/'%0D'}" | ||
echo "::error file=${file}::$errors" | ||
exit=1 | ||
fi | ||
done | ||
if [ "${exit}" == "1" ]; then | ||
exit 1; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build Sphinx Doc | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build-doc: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Packages | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install plantuml tox python3-pip -y | ||
- name: Build static site with Tox | ||
run: | | ||
cd doc | ||
tox -e py3-html | ||
- name: Deploy Preview | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: doc/build/html | ||
destination_dir: 'previews/${{ github.event.number }}' | ||
|
||
- name: Create status check with preview link | ||
run: | | ||
PREVIEW_URL="https://flownexus-lwm2m.github.io/waterlevel_monitor/previews/${{ github.event.number }}" | ||
PAYLOAD=$(echo '{}' | jq --arg name 'Documentation Preview' --arg url "${PREVIEW_URL}" '{"name": $name, "head_sha": "${{ github.event.pull_request.head.sha }}", "details_url": $url, "status": "completed", "conclusion": "success", "output": {"title": $name, "summary": "Preview available at", "text": $url}}') | ||
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Content-Type: application/json" \ | ||
-X POST -d "${PAYLOAD}" \ | ||
"https://api.github.com/repos/${{ github.repository }}/check-runs" |
Oops, something went wrong.