mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-27 10:00:25 +08:00
A board that still carries its own px4io binary in extras/ collided with the one added via CONFIG_BOARD_IO and failed CMake generate with a duplicate custom rule error. Several open board PRs add one, so fail configure with a message naming the file to delete instead. check_px4io copied the build output over the committed binaries, which leaves changed binaries behind when run with a different toolchain. Compare with cmp instead. The CI job now only runs check_px4io, which already builds both IO boards, instead of building them twice. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Julian Oes <julian@oes.ch>
170 lines
5.1 KiB
YAML
170 lines
5.1 KiB
YAML
name: Checks
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
pull_request:
|
|
branches:
|
|
- '**'
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
gate_checks:
|
|
name: Gate Checks [${{ matrix.check }}]
|
|
runs-on: [runs-on,runner=2cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
|
|
container:
|
|
image: ghcr.io/px4/px4-dev:v1.17.0-rc2
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
check: [
|
|
"check_format",
|
|
"check_newlines",
|
|
"validate_module_configs",
|
|
"shellcheck_all",
|
|
"module_documentation",
|
|
]
|
|
steps:
|
|
- uses: runs-on/action@v2
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Configure Git Safe Directory
|
|
run: git config --system --add safe.directory '*'
|
|
|
|
- name: Building [${{ matrix.check }}]
|
|
env:
|
|
PX4_SBOM_DISABLE: 1
|
|
run: make ${{ matrix.check }}
|
|
|
|
# The committed px4io firmware binaries must match what the current sources build to.
|
|
# The build is reproducible with a fixed toolchain, so a mismatch means a dependency
|
|
# changed without "make px4io_update", and the job fails.
|
|
px4io_firmware:
|
|
name: IO Firmware Up To Date
|
|
runs-on: [runs-on,runner=2cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
|
|
container:
|
|
image: ghcr.io/px4/px4-dev:v1.17.0-rc2
|
|
steps:
|
|
- uses: runs-on/action@v2
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Configure Git Safe Directory
|
|
run: git config --system --add safe.directory '*'
|
|
|
|
- name: Build and compare px4io firmware
|
|
env:
|
|
PX4_SBOM_DISABLE: 1
|
|
run: make check_px4io
|
|
|
|
tests:
|
|
name: Unit Tests
|
|
runs-on: [runs-on,runner=8cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
|
|
container:
|
|
image: ghcr.io/px4/px4-dev:v1.17.0-rc2
|
|
permissions:
|
|
contents: write
|
|
env:
|
|
GIT_COMMITTER_EMAIL: bot@px4.io
|
|
GIT_COMMITTER_NAME: PX4BuildBot
|
|
steps:
|
|
- uses: runs-on/action@v2
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Configure Git Safe Directory
|
|
run: git config --system --add safe.directory '*'
|
|
|
|
- uses: ./.github/actions/setup-ccache
|
|
id: ccache
|
|
with:
|
|
cache-key-prefix: ccache-sitl
|
|
max-size: 300M
|
|
|
|
- name: Build and run unit tests
|
|
env:
|
|
PX4_SBOM_DISABLE: 1
|
|
# Each tree is deleted once its tests pass so only one sits on disk at a time.
|
|
run: |
|
|
make tests
|
|
rm -rf build/px4_sitl_test
|
|
make tests_daa_crosstrack
|
|
rm -rf build/px4_sitl_test-daa-crosstrack
|
|
make tests_vtest_moving
|
|
rm -rf build/px4_sitl_vtest-moving
|
|
make tests_neural
|
|
rm -rf build/px4_sitl_neural
|
|
make tests_nocache
|
|
rm -rf build/px4_sitl_test-nocache
|
|
|
|
- uses: ./.github/actions/save-ccache
|
|
if: always()
|
|
with:
|
|
cache-primary-key: ${{ steps.ccache.outputs.cache-primary-key }}
|
|
|
|
- name: Auto-update EKF change indication baselines
|
|
uses: stefanzweifel/git-auto-commit-action@v7
|
|
with:
|
|
file_pattern: 'src/modules/ekf2/test/change_indication/*.csv'
|
|
commit_user_name: ${{ env.GIT_COMMITTER_NAME }}
|
|
commit_user_email: ${{ env.GIT_COMMITTER_EMAIL }}
|
|
commit_message: |
|
|
[AUTO COMMIT] update EKF change indication
|
|
|
|
See .github/workflows/checks.yml for more details
|
|
|
|
- name: Check for EKF functional changes
|
|
run: git diff --exit-code
|
|
working-directory: src/modules/ekf2/test/change_indication
|
|
|
|
# Separate from Unit Tests: the instrumented build shifts EKF float output, which
|
|
# would trip the change indication auto-commit above.
|
|
coverage:
|
|
name: Unit Test Coverage
|
|
runs-on: [runs-on,runner=8cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
|
|
container:
|
|
image: ghcr.io/px4/px4-dev:v1.17.0-rc2
|
|
steps:
|
|
- uses: runs-on/action@v2
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Configure Git Safe Directory
|
|
run: git config --system --add safe.directory '*'
|
|
|
|
- uses: ./.github/actions/setup-ccache
|
|
id: ccache
|
|
with:
|
|
cache-key-prefix: ccache-unittests-coverage
|
|
max-size: 300M
|
|
|
|
- name: Build and run unit tests with coverage
|
|
env:
|
|
PX4_SBOM_DISABLE: 1
|
|
run: make tests_coverage
|
|
|
|
- name: Upload Coverage Information to Codecov
|
|
uses: codecov/codecov-action@v6
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
flags: unittests
|
|
files: coverage/lcov.info
|
|
disable_search: true
|
|
|
|
- uses: ./.github/actions/save-ccache
|
|
if: always()
|
|
with:
|
|
cache-primary-key: ${{ steps.ccache.outputs.cache-primary-key }}
|