2021-05-06 10:32:05 -03:00
|
|
|
name: test coverage
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * 0' # every sunday at midnight
|
|
|
|
# paths:
|
|
|
|
# - "*"
|
|
|
|
# - "!README.md" <-- don't rebuild on doc change
|
2021-06-23 04:42:11 -03:00
|
|
|
concurrency:
|
|
|
|
group: ci-${{github.workflow}}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2021-05-06 10:32:05 -03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-08-31 18:25:51 -03:00
|
|
|
runs-on: ubuntu-22.04
|
2021-05-06 10:32:05 -03:00
|
|
|
container:
|
2023-11-21 17:27:07 -04:00
|
|
|
image: ardupilot/ardupilot-dev-${{ matrix.type }}:v0.1.3
|
2021-06-13 09:58:33 -03:00
|
|
|
options: --privileged
|
2021-05-06 10:32:05 -03:00
|
|
|
strategy:
|
|
|
|
fail-fast: false # don't cancel if a job from the matrix fails
|
|
|
|
matrix:
|
|
|
|
toolchain: [
|
|
|
|
base, # GCC
|
|
|
|
]
|
|
|
|
config: [
|
|
|
|
coverage,
|
2021-06-13 09:58:33 -03:00
|
|
|
sitltest-can,
|
2021-05-06 10:32:05 -03:00
|
|
|
]
|
2023-02-03 04:59:53 -04:00
|
|
|
type: [
|
|
|
|
coverage,
|
|
|
|
]
|
|
|
|
include:
|
|
|
|
- config: sitltest-can
|
|
|
|
type: periph
|
|
|
|
exclude:
|
|
|
|
- config: sitltest-can
|
|
|
|
type: coverage
|
2021-05-06 10:32:05 -03:00
|
|
|
steps:
|
|
|
|
# git checkout the PR
|
2023-11-21 17:29:41 -04:00
|
|
|
- uses: actions/checkout@v4
|
2021-05-06 10:32:05 -03:00
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
|
|
|
# Put ccache into github cache for faster build
|
|
|
|
- name: Prepare ccache timestamp
|
|
|
|
id: ccache_cache_timestamp
|
|
|
|
run: |
|
|
|
|
NOW=$(date -u +"%F-%T")
|
2023-02-07 12:48:57 -04:00
|
|
|
echo "timestamp=${NOW}" >> $GITHUB_OUTPUT
|
2021-05-06 10:32:05 -03:00
|
|
|
- name: ccache cache files
|
2022-12-09 07:47:48 -04:00
|
|
|
uses: actions/cache@v3
|
2021-05-06 10:32:05 -03:00
|
|
|
with:
|
|
|
|
path: ~/.ccache
|
|
|
|
key: ${{github.workflow}}-ccache-${{ matrix.toolchain }}-${{steps.ccache_cache_timestamp.outputs.timestamp}}
|
|
|
|
restore-keys: ${{github.workflow}}-ccache-${{ matrix.toolchain }}- # restore ccache from either previous build on this branch or on master
|
|
|
|
- name: setup ccache
|
|
|
|
run: |
|
2022-02-22 01:23:32 -04:00
|
|
|
. .github/workflows/ccache.env
|
2021-05-06 10:32:05 -03:00
|
|
|
- name: test ${{matrix.config}} ${{ matrix.toolchain }}
|
|
|
|
env:
|
|
|
|
CI_BUILD_TARGET: ${{matrix.config}}
|
2022-05-16 08:14:23 -03:00
|
|
|
TERM: xterm
|
2021-05-06 10:32:05 -03:00
|
|
|
shell: 'script -q -e -c "bash {0}"'
|
|
|
|
run: |
|
2023-02-03 13:45:49 -04:00
|
|
|
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
2021-05-06 10:32:05 -03:00
|
|
|
PATH="/github/home/.local/bin:$PATH"
|
2023-01-09 07:17:13 -04:00
|
|
|
python -m pip install --progress-bar off --user mavproxy
|
2021-05-06 10:32:05 -03:00
|
|
|
python -m pip uninstall -y pymavlink
|
2023-02-03 04:59:53 -04:00
|
|
|
git submodule update --init --recursive --depth=1
|
2023-01-09 07:17:13 -04:00
|
|
|
(cd modules/mavlink/pymavlink && DISABLE_MAVNATIVE=True MDEF="$PWD/../message_definitions" python -m pip install --progress-bar off --user .)
|
2021-06-28 09:08:22 -03:00
|
|
|
if [[ ${{ matrix.config }} == "coverage" ]]; then
|
2021-06-13 09:58:33 -03:00
|
|
|
Tools/scripts/run_coverage.py -f
|
|
|
|
else
|
|
|
|
Tools/scripts/run_coverage.py -i
|
|
|
|
./waf configure --board sitl_periph_gps --debug --coverage
|
|
|
|
./waf build --target bin/AP_Periph
|
|
|
|
Tools/scripts/run_coverage.py -i
|
|
|
|
Tools/autotest/autotest.py test.CAN --debug --coverage
|
|
|
|
Tools/scripts/run_coverage.py -u
|
|
|
|
fi
|
2021-05-06 10:32:05 -03:00
|
|
|
|
|
|
|
- name: Coveralls
|
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
path-to-lcov: ./reports/lcov-report/lcov.info
|
2021-06-13 09:58:33 -03:00
|
|
|
flag-name: run-${{matrix.config}}
|
|
|
|
parallel: true
|
|
|
|
|
|
|
|
|
|
|
|
finish:
|
|
|
|
if: always()
|
|
|
|
needs: build
|
2023-08-31 18:25:51 -03:00
|
|
|
runs-on: ubuntu-22.04
|
2021-06-13 09:58:33 -03:00
|
|
|
steps:
|
|
|
|
- name: Coveralls Finished
|
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.github_token }}
|
|
|
|
parallel-finished: true
|