Skip to content

Use Zephyr GitHub action for CI #275

Use Zephyr GitHub action for CI

Use Zephyr GitHub action for CI #275

Workflow file for this run

name: Zephyr unit testing and docs build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
# env:
# CMAKE_PREFIX_PATH: /opt/toolchains
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: thingset-node-c
fetch-depth: 0 # necessary to get tags
- name: Setup Zephyr project
uses: zephyrproject-rtos/action-zephyr-setup@v1
with:
app-path: thingset-node-c
# toolchains: x86_64-zephyr-elf
- name: Trailing whitespace check
working-directory: thingset-node-c
run: |
git diff --check `git rev-list HEAD | tail -n 1`..
# - name: Initialize west workspace
# working-directory: thingset-node-c
# run: |
# west init -l .
# west update
- name: Install docs dependencies
working-directory: thingset-node-c
run: |
sudo apt-get update
sudo apt-get install -y doxygen lcov
pip3 install -r docs/requirements.txt
- name: Run unit tests
working-directory: thingset-node-c
run: |
../zephyr/scripts/twister --integration --testsuite-root ./tests --inline-logs
- name: Generate coverage report
working-directory: thingset-node-c
run: |
west build -b native_posix tests/protocol -t run
lcov --capture --directory build/modules/thingset-node-c --output-file build/lcov.info --rc lcov_branch_coverage=1 --exclude '*zephyr*' --exclude '*lib*'
genhtml build/lcov.info --output-directory build/lcov_html --ignore-errors source --branch-coverage --highlight --legend
- name: Build documentation
working-directory: thingset-node-c
run: |
cd docs
make html
cp -r ../build/lcov_html build/html/coverage
- name: Deploy docs and coverage report to gh-pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./thingset-node-c/docs/build/html/
enable_jekyll: false
allow_empty_commit: false
force_orphan: true
publish_branch: gh-pages