parent
1f66a8b908
commit
fbb00f38d3
|
|
@ -56,3 +56,64 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: Firmware
|
name: Firmware
|
||||||
path: build/*.hex
|
path: build/*.hex
|
||||||
|
|
||||||
|
tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
# setup base required dependencies
|
||||||
|
- name: Setup dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get install gcc g++ cmake ninja-build python3-pyelftools python3-regex python3-polib
|
||||||
|
|
||||||
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
|
- name: Checkout ${{ github.event.pull_request.head.ref }}
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
if: ${{ github.event.pull_request }}
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Checkout ${{ github.event.ref }}
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
if: ${{ !github.event.pull_request }}
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.ref }}
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Cache Dependencies
|
||||||
|
uses: actions/cache@v3.0.11
|
||||||
|
id: cache-pkgs
|
||||||
|
with:
|
||||||
|
path: ".dependencies"
|
||||||
|
key: "build-deps-1_0_0-linux"
|
||||||
|
|
||||||
|
- name: Setup build dependencies
|
||||||
|
run: |
|
||||||
|
./utils/bootstrap.py
|
||||||
|
|
||||||
|
- name: Cache permissions
|
||||||
|
run: sudo chmod -R 744 .dependencies
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake .. -G Ninja
|
||||||
|
ninja test_coverage_report
|
||||||
|
|
||||||
|
- name: Add PR Comment
|
||||||
|
if: ${{ github.event.pull_request }}
|
||||||
|
uses: mshick/add-pr-comment@v2
|
||||||
|
with:
|
||||||
|
message-path: build/Summary.txt
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@v3.1.1
|
||||||
|
with:
|
||||||
|
name: Coverage
|
||||||
|
path: build/Coverage
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,20 @@ jobs:
|
||||||
- name: Checkout base
|
- name: Checkout base
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Cache Dependencies
|
||||||
|
uses: actions/cache@v3.0.11
|
||||||
|
id: cache-pkgs
|
||||||
|
with:
|
||||||
|
path: ".dependencies"
|
||||||
|
key: "build-deps-1_0_0-linux"
|
||||||
|
|
||||||
- name: Setup build dependencies
|
- name: Setup build dependencies
|
||||||
run: |
|
run: |
|
||||||
./utils/bootstrap.py
|
./utils/bootstrap.py
|
||||||
|
|
||||||
|
- name: Cache permissions
|
||||||
|
run: sudo chmod -R 744 .dependencies
|
||||||
|
|
||||||
- name: Build base
|
- name: Build base
|
||||||
run: |
|
run: |
|
||||||
rm -rf build-base
|
rm -rf build-base
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,8 @@ if(GCOV_ENABLE)
|
||||||
COMMAND tar -zcvf Coverage.tar.gz Coverage
|
COMMAND tar -zcvf Coverage.tar.gz Coverage
|
||||||
# Cheat and compare a file to itself to check for existence. File-Not-Found is a failure
|
# Cheat and compare a file to itself to check for existence. File-Not-Found is a failure
|
||||||
# code.
|
# code.
|
||||||
COMMAND ../../utils/gcovr.py -r . -e '../../tests' -e '../../lib/Catch2' | tee Summary.txt
|
COMMAND ${PROJECT_SOURCE_DIR}/utils/gcovr.py -r . -e '../../tests' -e '../../lib/Catch2' | tee
|
||||||
|
Summary.txt
|
||||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/.ctest-finished
|
COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/.ctest-finished
|
||||||
${PROJECT_BINARY_DIR}/.ctest-finished
|
${PROJECT_BINARY_DIR}/.ctest-finished
|
||||||
BYPRODUCTS ${PROJECT_BINARY_DIR}/Summary.txt ${PROJECT_BINARY_DIR}/Coverage.tar.gz
|
BYPRODUCTS ${PROJECT_BINARY_DIR}/Summary.txt ${PROJECT_BINARY_DIR}/Coverage.tar.gz
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue