2020-09-02 06:01:42 -03:00
|
|
|
name: test plane
|
|
|
|
|
2023-02-08 18:33:17 -04:00
|
|
|
on:
|
2022-10-18 11:21:53 -03:00
|
|
|
push:
|
2023-02-08 18:33:17 -04:00
|
|
|
paths-ignore:
|
|
|
|
# remove other vehicles
|
2022-10-18 11:21:53 -03:00
|
|
|
- 'AntennaTracker/**'
|
2023-02-08 18:33:17 -04:00
|
|
|
- 'ArduCopter/**'
|
2022-10-18 11:21:53 -03:00
|
|
|
- 'ArduSub/**'
|
|
|
|
- 'Blimp/**'
|
2023-02-08 18:33:17 -04:00
|
|
|
- 'Rover/**'
|
|
|
|
# remove non SITL HAL
|
|
|
|
- 'libraries/AP_HAL_ChibiOS/**'
|
|
|
|
- 'libraries/AP_HAL_ESP32/**'
|
|
|
|
# remove non SITL directories
|
|
|
|
- 'Tools/AP_Bootloader/**'
|
|
|
|
- 'Tools/AP_Periph/**'
|
|
|
|
- 'Tools/bootloaders/**'
|
|
|
|
- 'Tools/CHDK-Script/**'
|
|
|
|
- 'Tools/CodeStyle/**'
|
|
|
|
- 'Tools/completion/**'
|
|
|
|
- 'Tools/CPUInfo/**'
|
|
|
|
- 'Tools/debug/**'
|
|
|
|
- 'Tools/environment_install/**'
|
|
|
|
- 'Tools/FilterTestTool/**'
|
|
|
|
- 'Tools/Frame_params/**'
|
|
|
|
- 'Tools/geotag/**'
|
|
|
|
- 'Tools/GIT_Test/**'
|
|
|
|
- 'Tools/gittools/**'
|
|
|
|
- 'Tools/Hello/**'
|
|
|
|
- 'Tools/IO_Firmware/**'
|
|
|
|
- 'Tools/Linux_HAL_Essentials/**'
|
|
|
|
- 'Tools/LogAnalyzer/**'
|
|
|
|
- 'Tools/Pozyx/**'
|
|
|
|
- 'Tools/PrintVersion.py'
|
|
|
|
- 'Tools/Replay/**'
|
|
|
|
- 'Tools/simulink/**'
|
|
|
|
- 'Tools/UDP_Proxy/**'
|
|
|
|
- 'Tools/vagrant/**'
|
|
|
|
- 'Tools/Vicon/**'
|
|
|
|
# Discard python file from Tools/scripts as not used
|
|
|
|
- 'Tools/scripts/**.py'
|
|
|
|
- 'Tools/scripts/build_sizes/**'
|
|
|
|
- 'Tools/scripts/build_tests/**'
|
|
|
|
- 'Tools/scripts/CAN/**'
|
|
|
|
- 'Tools/scripts/signing/**'
|
|
|
|
# Remove other vehicles autotest
|
|
|
|
- 'Tools/autotest/antennatracker.py'
|
|
|
|
- 'Tools/autotest/arducopter.py'
|
|
|
|
- 'Tools/autotest/ardusub.py'
|
|
|
|
- 'Tools/autotest/balancebot.py'
|
|
|
|
- 'Tools/autotest/helicopter.py'
|
|
|
|
- 'Tools/autotest/location.txt'
|
|
|
|
- 'Tools/autotest/rover.py'
|
|
|
|
- 'Tools/autotest/sailboat.py'
|
|
|
|
- 'Tools/autotest/swarminit.txt'
|
|
|
|
# Remove markdown files as irrelevant
|
|
|
|
- '**.md'
|
|
|
|
# Remove dotfile at root directory
|
|
|
|
- './.dir-locals.el'
|
|
|
|
- './.dockerignore'
|
|
|
|
- './.editorconfig'
|
|
|
|
- './.flake8'
|
|
|
|
- './.gitattributes'
|
|
|
|
- './.github'
|
|
|
|
- './.gitignore'
|
|
|
|
- './.pre-commit-config.yaml'
|
|
|
|
- './.pydevproject'
|
|
|
|
- './.valgrind-suppressions'
|
|
|
|
- './.valgrindrc'
|
|
|
|
- 'Dockerfile'
|
|
|
|
- 'Vagrantfile'
|
|
|
|
- 'Makefile'
|
|
|
|
# Remove some directories check
|
|
|
|
- '.vscode/**'
|
|
|
|
- '.github/ISSUE_TEMPLATE/**'
|
2023-08-22 19:06:17 -03:00
|
|
|
# Remove change on other workflows
|
|
|
|
- '.github/workflows/test_environment.yml'
|
2022-10-18 11:21:53 -03:00
|
|
|
|
|
|
|
pull_request:
|
2023-02-08 18:33:17 -04:00
|
|
|
paths-ignore:
|
|
|
|
# remove other vehicles
|
2022-10-18 11:21:53 -03:00
|
|
|
- 'AntennaTracker/**'
|
2023-02-08 18:33:17 -04:00
|
|
|
- 'ArduCopter/**'
|
2022-10-18 11:21:53 -03:00
|
|
|
- 'ArduSub/**'
|
|
|
|
- 'Blimp/**'
|
2023-02-08 18:33:17 -04:00
|
|
|
- 'Rover/**'
|
|
|
|
# remove non SITL HAL
|
|
|
|
- 'libraries/AP_HAL_ChibiOS/**'
|
|
|
|
- 'libraries/AP_HAL_ESP32/**'
|
|
|
|
# remove non SITL directories
|
|
|
|
- 'Tools/AP_Bootloader/**'
|
|
|
|
- 'Tools/AP_Periph/**'
|
|
|
|
- 'Tools/bootloaders/**'
|
|
|
|
- 'Tools/CHDK-Script/**'
|
|
|
|
- 'Tools/CodeStyle/**'
|
|
|
|
- 'Tools/completion/**'
|
|
|
|
- 'Tools/CPUInfo/**'
|
|
|
|
- 'Tools/debug/**'
|
|
|
|
- 'Tools/environment_install/**'
|
|
|
|
- 'Tools/FilterTestTool/**'
|
|
|
|
- 'Tools/Frame_params/**'
|
|
|
|
- 'Tools/geotag/**'
|
|
|
|
- 'Tools/GIT_Test/**'
|
|
|
|
- 'Tools/gittools/**'
|
|
|
|
- 'Tools/Hello/**'
|
|
|
|
- 'Tools/IO_Firmware/**'
|
|
|
|
- 'Tools/Linux_HAL_Essentials/**'
|
|
|
|
- 'Tools/LogAnalyzer/**'
|
|
|
|
- 'Tools/Pozyx/**'
|
|
|
|
- 'Tools/PrintVersion.py'
|
|
|
|
- 'Tools/Replay/**'
|
|
|
|
- 'Tools/simulink/**'
|
|
|
|
- 'Tools/UDP_Proxy/**'
|
|
|
|
- 'Tools/vagrant/**'
|
|
|
|
- 'Tools/Vicon/**'
|
|
|
|
# Discard python file from Tools/scripts as not used
|
|
|
|
- 'Tools/scripts/**.py'
|
|
|
|
- 'Tools/scripts/build_sizes/**'
|
|
|
|
- 'Tools/scripts/build_tests/**'
|
|
|
|
- 'Tools/scripts/CAN/**'
|
|
|
|
- 'Tools/scripts/signing/**'
|
|
|
|
# Remove other vehicles autotest
|
|
|
|
- 'Tools/autotest/antennatracker.py'
|
|
|
|
- 'Tools/autotest/arducopter.py'
|
|
|
|
- 'Tools/autotest/ardusub.py'
|
|
|
|
- 'Tools/autotest/balancebot.py'
|
|
|
|
- 'Tools/autotest/helicopter.py'
|
|
|
|
- 'Tools/autotest/location.txt'
|
|
|
|
- 'Tools/autotest/rover.py'
|
|
|
|
- 'Tools/autotest/sailboat.py'
|
|
|
|
- 'Tools/autotest/swarminit.txt'
|
|
|
|
# Remove markdown files as irrelevant
|
|
|
|
- '**.md'
|
|
|
|
# Remove dotfile at root directory
|
|
|
|
- './.dir-locals.el'
|
|
|
|
- './.dockerignore'
|
|
|
|
- './.editorconfig'
|
|
|
|
- './.flake8'
|
|
|
|
- './.gitattributes'
|
|
|
|
- './.github'
|
|
|
|
- './.gitignore'
|
|
|
|
- './.pre-commit-config.yaml'
|
|
|
|
- './.pydevproject'
|
|
|
|
- './.valgrind-suppressions'
|
|
|
|
- './.valgrindrc'
|
|
|
|
- 'Dockerfile'
|
|
|
|
- 'Vagrantfile'
|
|
|
|
- 'Makefile'
|
|
|
|
# Remove some directories check
|
|
|
|
- '.vscode/**'
|
|
|
|
- '.github/ISSUE_TEMPLATE/**'
|
2023-08-22 19:06:17 -03:00
|
|
|
# Remove change on other workflows
|
|
|
|
- '.github/workflows/test_environment.yml'
|
2022-10-18 11:21:53 -03:00
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
2021-06-23 04:42:11 -03:00
|
|
|
concurrency:
|
|
|
|
group: ci-${{github.workflow}}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2020-09-02 06:01:42 -03:00
|
|
|
|
|
|
|
jobs:
|
2020-11-12 15:42:51 -04:00
|
|
|
build:
|
2023-08-31 18:25:51 -03:00
|
|
|
runs-on: ubuntu-22.04
|
2023-11-21 17:27:07 -04:00
|
|
|
container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:v0.1.3
|
2020-11-12 15:42:51 -04:00
|
|
|
strategy:
|
|
|
|
fail-fast: false # don't cancel if a job from the matrix fails
|
|
|
|
matrix:
|
|
|
|
toolchain: [
|
|
|
|
base, # GCC
|
|
|
|
clang,
|
|
|
|
]
|
2020-09-02 06:01:42 -03:00
|
|
|
steps:
|
|
|
|
# git checkout the PR
|
2023-11-21 17:29:41 -04:00
|
|
|
- uses: actions/checkout@v4
|
2020-09-02 06:01:42 -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-03 04:59:53 -04:00
|
|
|
echo "timestamp=${NOW}" >> $GITHUB_OUTPUT
|
2020-09-02 06:01:42 -03:00
|
|
|
- name: ccache cache files
|
2022-12-09 07:47:48 -04:00
|
|
|
uses: actions/cache@v3
|
2020-09-02 06:01:42 -03:00
|
|
|
with:
|
|
|
|
path: ~/.ccache
|
2020-11-12 15:42:51 -04:00
|
|
|
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
|
2020-09-02 06:01:42 -03:00
|
|
|
- name: setup ccache
|
|
|
|
run: |
|
2022-02-22 01:23:32 -04:00
|
|
|
. .github/workflows/ccache.env
|
2020-11-12 15:42:51 -04:00
|
|
|
- name: build plane ${{ matrix.toolchain }}
|
2020-09-02 06:01:42 -03:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2023-02-03 13:45:49 -04:00
|
|
|
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
2021-06-28 09:08:22 -03:00
|
|
|
if [[ ${{ matrix.toolchain }} == "clang" ]]; then
|
2021-09-27 07:33:50 -03:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
2020-11-12 15:42:51 -04:00
|
|
|
fi
|
2020-09-02 06:01:42 -03:00
|
|
|
PATH="/github/home/.local/bin:$PATH"
|
2024-02-08 05:32:06 -04:00
|
|
|
./waf configure --board sitl --debug
|
2020-09-02 06:01:42 -03:00
|
|
|
./waf build --target bin/arduplane
|
|
|
|
ccache -s
|
|
|
|
ccache -z
|
|
|
|
|
|
|
|
autotest:
|
2020-11-12 15:42:51 -04:00
|
|
|
needs: build # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build
|
2023-08-31 18:25:51 -03:00
|
|
|
runs-on: ubuntu-22.04
|
2021-01-14 04:51:48 -04:00
|
|
|
container:
|
2023-11-21 17:27:07 -04:00
|
|
|
image: ardupilot/ardupilot-dev-base:v0.1.3
|
2021-01-14 04:51:48 -04:00
|
|
|
options: --privileged --cap-add=SYS_PTRACE --security-opt apparmor=unconfined --security-opt seccomp=unconfined
|
2020-09-02 06:01:42 -03:00
|
|
|
strategy:
|
|
|
|
fail-fast: false # don't cancel if a job from the matrix fails
|
|
|
|
matrix:
|
|
|
|
config: [
|
|
|
|
sitltest-plane,
|
|
|
|
sitltest-quadplane,
|
|
|
|
]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
# git checkout the PR
|
2023-11-21 17:29:41 -04:00
|
|
|
- uses: actions/checkout@v4
|
2020-09-02 06:01:42 -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-03 04:59:53 -04:00
|
|
|
echo "timestamp=${NOW}" >> $GITHUB_OUTPUT
|
2020-09-02 06:01:42 -03:00
|
|
|
- name: ccache cache files
|
2023-02-08 13:44:22 -04:00
|
|
|
uses: actions/cache/restore@v3
|
2020-09-02 06:01:42 -03:00
|
|
|
with:
|
|
|
|
path: ~/.ccache
|
2020-11-12 15:42:51 -04:00
|
|
|
key: ${{github.workflow}}-ccache-base-${{steps.ccache_cache_timestamp.outputs.timestamp}}
|
|
|
|
restore-keys: ${{github.workflow}}-ccache-base- # restore ccache from either previous build on this branch or on master
|
2020-09-02 06:01:42 -03:00
|
|
|
- name: setup ccache
|
|
|
|
run: |
|
2022-02-22 01:23:32 -04:00
|
|
|
. .github/workflows/ccache.env
|
2020-09-02 06:01:42 -03:00
|
|
|
- name: test ${{matrix.config}}
|
|
|
|
env:
|
|
|
|
CI_BUILD_TARGET: ${{matrix.config}}
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2023-02-03 13:45:49 -04:00
|
|
|
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
2020-09-02 06:01:42 -03:00
|
|
|
PATH="/github/home/.local/bin:$PATH"
|
|
|
|
Tools/scripts/build_ci.sh
|
2020-10-23 01:56:26 -03:00
|
|
|
|
|
|
|
- name: Archive buildlog artifacts
|
2023-01-16 11:28:24 -04:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-02-08 01:27:36 -04:00
|
|
|
if: failure()
|
2020-10-23 01:56:26 -03:00
|
|
|
with:
|
2021-02-08 01:27:36 -04:00
|
|
|
name: fail-${{matrix.config}}
|
2021-05-05 21:28:38 -03:00
|
|
|
path: |
|
|
|
|
/tmp/buildlogs
|
|
|
|
/__w/ardupilot/ardupilot/logs
|
2021-07-06 02:59:23 -03:00
|
|
|
/__w/ardupilot/ardupilot/ap-*.core
|
|
|
|
/__w/ardupilot/ardupilot/core.*
|
|
|
|
/__w/ardupilot/ardupilot/dumpstack.sh_*
|
|
|
|
/__w/ardupilot/ardupilot/dumpcore.sh_*
|
2020-10-23 01:56:26 -03:00
|
|
|
retention-days: 14
|
|
|
|
|
|
|
|
- name: Archive .bin artifacts
|
2023-01-16 11:28:24 -04:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-10-23 01:56:26 -03:00
|
|
|
with:
|
2021-02-08 01:27:36 -04:00
|
|
|
name: BIN-${{matrix.config}}
|
2020-10-23 01:56:26 -03:00
|
|
|
path: /__w/ardupilot/ardupilot/logs
|
|
|
|
retention-days: 7
|
|
|
|
|