-
Notifications
You must be signed in to change notification settings - Fork 19
50 lines (48 loc) · 1.67 KB
/
run_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Run Tests
on: [push, pull_request]
permissions:
checks: write
pull-requests: write
jobs:
run-test:
runs-on: ubuntu-latest
if: ${{!github.event.pull_request.draft}}
steps:
- name: Checkout repo and submodules
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Build Firmware
uses: ./.github/actions/build
with:
BUILD_WRAPPER_OUT_DIR: build_wrapper_out_dir
- name: Cache test setup
uses: actions/cache@v3
with:
path: |
./test/build
key: ${{ hashFiles('./test/**/*.cpp') }}
- name: Install dependencies
run: |
MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
eval "${MATRIX_EVAL}"
pip install gcovr
gcovr --version
- name: Run Test
run: |
./test/test.sh -s
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
./test/build/xml_out/*
- name: Analyze with SonarCloud
if: github.repository == 'AllYarnsAreBeautiful/ayab-firmware' && ( ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'AllYarnsAreBeautiful/ayab-firmware' ) || github.event_name == 'push' )
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_WRAPPER_OUT_DIR: build_wrapper_out_dir
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.coverageReportPaths="./test/build/coverage.xml"