Issue 16 - testing and coverage #21
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
name: Develop | |
on: | |
push: | |
branches: [ "develop" ] | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
analysis: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install clang-tidy | |
run: sudo apt-get install -y clang-tidy | |
- name: Run clang-tidy | |
run: clang-tidy src/*.c src/*.h -- -Isrc -DGIT_INFO=\"$(git describe --always --tags)\" | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Prerequisites | |
run: | | |
sudo apt-get install -y build-essential gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu gcc-arm-linux-gnueabi binutils-arm-linux-gnueabi lcov | |
wget https://github.com/CE-Programming/toolchain/releases/latest/download/CEdev-Linux.tar.gz | |
tar zxpvf CEdev-Linux.tar.gz | |
rm CEdev-Linux.tar.gz | |
mv CEdev agdev | |
wget https://github.com/pcawte/AgDev/releases/download/v3.0.0/AgDev_release_v3.0.0_linux.zip | |
unzip -d agdev -o AgDev_release_v3.0.0_linux.zip | |
rm AgDev_release_v3.0.0_linux.zip | |
echo "$(pwd)/agdev/bin" >> $GITHUB_PATH | |
echo "AGDEV_BASE=$(pwd)/agdev" >> $GITHUB_ENV | |
- name: Make All | |
run: make all | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Prerequisites | |
run: | | |
sudo apt-get install -y lcov | |
- name: Run Tests | |
run: make test | |
- name: Generate Coverage Report | |
run: make coverage | |
- name: Upload Coverage Report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: coverage/html | |
- name: Setup lcov | |
uses: hrishikesh-kadam/setup-lcov@v1 | |
- name: Post Coverage Report to PR | |
uses: kefasjw/lcov-pull-request-report@v1 | |
with: | |
lcov-file: coverage/lcov.info | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
working-directory: . | |
comment-title: 'Coverage Report' | |
all-files-minimum-coverage: 80 | |
changed-files-minimum-coverage: 80 | |
artifact-name: coverage-report |