From af269df67727c0719ceaf869c96284c7c6a5bd80 Mon Sep 17 00:00:00 2001 From: Lokesh-Carbonix Date: Mon, 20 Nov 2023 15:10:00 -0800 Subject: [PATCH] CI: Update to master & limit push run of CI --- .github/workflows/cygwin_build.yml | 135 +++++++++++++++- .github/workflows/macos_build.yml | 140 ++++++++++++++++- .github/workflows/test_ccache.yml | 126 ++++++++++++++- .github/workflows/test_chibios.yml | 153 +++++++++++++++--- .github/workflows/test_environment.yml | 14 ++ .github/workflows/test_linux_sbc.yml | 138 ++++++++++++++++- .github/workflows/test_replay.yml | 149 +++++++++++++++++- .github/workflows/test_scripting_docs.yml | 12 +- .github/workflows/test_sitl_copter.yml | 181 ++++++++++++++++++++-- .github/workflows/test_sitl_periph.yml | 176 ++++++++++++++++++--- .github/workflows/test_sitl_plane.yml | 170 ++++++++++++++++++-- .github/workflows/test_sitl_rover.yml | 169 ++++++++++++++++++-- .github/workflows/test_sitl_sub.yml | 172 ++++++++++++++++++-- .github/workflows/test_sitl_tracker.yml | 172 ++++++++++++++++++-- .github/workflows/test_size.yml | 62 +++++++- .github/workflows/test_unit_tests.yml | 102 +++++++++++- 16 files changed, 1940 insertions(+), 131 deletions(-) diff --git a/.github/workflows/cygwin_build.yml b/.github/workflows/cygwin_build.yml index 3f5d35eb78..b7bf091939 100644 --- a/.github/workflows/cygwin_build.yml +++ b/.github/workflows/cygwin_build.yml @@ -1,6 +1,139 @@ name: Cygwin Build -on: [push, pull_request, workflow_dispatch] +on: + push: + branches: + - CxPilot + - master + paths-ignore: + # remove other vehicles + - 'AntennaTracker/**' + - 'Blimp/**' + # remove non SITL HAL + - 'libraries/AP_HAL_ChibiOS/**' + - 'libraries/AP_HAL_ESP32/**' + # remove non SITL directories + - 'Tools/AP_Bootloader/**' + - 'Tools/AP_Periph/**' + - 'Tools/CHDK-Script/**' + - 'Tools/CPUInfo/**' + - 'Tools/CodeStyle/**' + - 'Tools/FilterTestTool/**' + - 'Tools/Frame_params/**' + - 'Tools/GIT_Test/**' + - 'Tools/Hello/**' + - 'Tools/IO_Firmware/**' + - 'Tools/Linux_HAL_Essentials/**' + - 'Tools/LogAnalyzer/**' + - 'Tools/Pozyx/**' + - 'Tools/PrintVersion.py' + - 'Tools/Replay/**' + - 'Tools/UDP_Proxy/**' + - 'Tools/Vicon/**' + - 'Tools/bootloaders/**' + - 'Tools/completion/**' + - 'Tools/debug/**' + - 'Tools/environment_install/**' + - 'Tools/geotag/**' + - 'Tools/gittools/**' + - 'Tools/mavproxy_modules/**' + - 'Tools/simulink/**' + - 'Tools/vagrant/**' + # 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 autotest + - 'Tools/autotest/**' + # 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/**' + + pull_request: + paths-ignore: + # remove other vehicles + - 'AntennaTracker/**' + - 'Blimp/**' + # 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/mavproxy_modules/**' + - '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 autotest + - 'Tools/autotest/**' + # 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/**' + + workflow_dispatch: + concurrency: group: ci-${{github.workflow}}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml index 6b648caa96..00c66c8208 100644 --- a/.github/workflows/macos_build.yml +++ b/.github/workflows/macos_build.yml @@ -1,13 +1,146 @@ name: Macos Build -on: [push, pull_request, workflow_dispatch] +on: + push: + branches: + - CxPilot + - master + paths-ignore: + # remove other env install scripts + - 'Tools/environment_install/APM_install.sh' + - 'Tools/environment_install/install-ROS-ubuntu.sh' + - 'Tools/environment_install/install-prereqs-arch.sh' + - 'Tools/environment_install/install-prereqs-ubuntu.sh' + - 'Tools/environment_install/install-prereqs-windows-andAPMSource.ps1' + - 'Tools/environment_install/install-prereqs-windows.ps1' + # remove non esp32 HAL + - 'libraries/AP_HAL_ESP32/**' + # remove non SITL non stm32 directories + - 'Tools/AP_Bootloader/**' + - 'Tools/AP_Periph/**' + - 'Tools/CHDK-Script/**' + - 'Tools/CodeStyle/**' + - 'Tools/completion/**' + - 'Tools/CPUInfo/**' + - 'Tools/debug/**' + - 'Tools/FilterTestTool/**' + - 'Tools/Frame_params/**' + - 'Tools/geotag/**' + - 'Tools/GIT_Test/**' + - 'Tools/gittools/**' + - 'Tools/Hello/**' + - 'Tools/Linux_HAL_Essentials/**' + - 'Tools/LogAnalyzer/**' + - 'Tools/mavproxy_modules/**' + - '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 autotests stuff + - 'Tools/autotest/**' + # 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/**' + + pull_request: + paths-ignore: + # remove other env install scripts + - 'Tools/environment_install/APM_install.sh' + - 'Tools/environment_install/install-ROS-ubuntu.sh' + - 'Tools/environment_install/install-prereqs-arch.sh' + - 'Tools/environment_install/install-prereqs-ubuntu.sh' + - 'Tools/environment_install/install-prereqs-windows-andAPMSource.ps1' + - 'Tools/environment_install/install-prereqs-windows.ps1' + # remove non esp32 HAL + - 'libraries/AP_HAL_ESP32/**' + # remove non SITL non stm32 directories + - 'Tools/AP_Bootloader/**' + - 'Tools/AP_Periph/**' + - 'Tools/CHDK-Script/**' + - 'Tools/CodeStyle/**' + - 'Tools/completion/**' + - 'Tools/CPUInfo/**' + - 'Tools/debug/**' + - 'Tools/FilterTestTool/**' + - 'Tools/Frame_params/**' + - 'Tools/geotag/**' + - 'Tools/GIT_Test/**' + - 'Tools/gittools/**' + - 'Tools/Hello/**' + - 'Tools/Linux_HAL_Essentials/**' + - 'Tools/LogAnalyzer/**' + - 'Tools/mavproxy_modules/**' + - '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 autotests stuff + - 'Tools/autotest/**' + # 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/**' + + workflow_dispatch: + concurrency: group: ci-${{github.workflow}}-${{ github.ref }} cancel-in-progress: true jobs: build: - runs-on: 'macos-latest' + runs-on: macos-latest strategy: fail-fast: false # don't cancel if a job from the matrix fails matrix: @@ -31,9 +164,10 @@ jobs: # Put ccache into github cache for faster build - name: Prepare ccache timestamp id: ccache_cache_timestamp + shell: bash run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files uses: actions/cache@v3 with: diff --git a/.github/workflows/test_ccache.yml b/.github/workflows/test_ccache.yml index 3f3ba047df..062df2173e 100644 --- a/.github/workflows/test_ccache.yml +++ b/.github/workflows/test_ccache.yml @@ -1,9 +1,123 @@ name: test ccache -on: [push, pull_request, workflow_dispatch] -# paths: -# - "*" -# - "!README.md" <-- don't rebuild on doc change +on: + push: + branches: + - CxPilot + - master + paths-ignore: + # remove other vehicles + - 'AntennaTracker/**' + - 'ArduPlane/**' + - 'ArduSub/**' + - 'Blimp/**' + - 'Rover/**' + # remove non chibios HAL + - 'libraries/AP_HAL_Linux/**' + - 'libraries/AP_HAL_ESP32/**' + - 'libraries/AP_HAL_SITL/**' + # remove non stm directories + - 'Tools/CHDK-Script/**' + - 'Tools/CodeStyle/**' + - 'Tools/completion/**' + - 'Tools/debug/**' + - 'Tools/environment_install/**' + - 'Tools/FilterTestTool/**' + - 'Tools/Frame_params/**' + - 'Tools/geotag/**' + - 'Tools/GIT_Test/**' + - 'Tools/gittools/**' + - 'Tools/Hello/**' + - 'Tools/LogAnalyzer/**' + - 'Tools/mavproxy_modules/**' + - 'Tools/Pozyx/**' + - 'Tools/PrintVersion.py' + - 'Tools/Replay/**' + - 'Tools/simulink/**' + - 'Tools/UDP_Proxy/**' + - 'Tools/vagrant/**' + - 'Tools/Vicon/**' + # Remove autotests stuff + - 'Tools/autotest/**' + # 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/**' + + pull_request: + paths-ignore: + # remove other vehicles + - 'AntennaTracker/**' + - 'ArduPlane/**' + - 'ArduSub/**' + - 'Blimp/**' + - 'Rover/**' + # remove non chibios HAL + - 'libraries/AP_HAL_Linux/**' + - 'libraries/AP_HAL_ESP32/**' + - 'libraries/AP_HAL_SITL/**' + # remove non stm directories + - 'Tools/CHDK-Script/**' + - 'Tools/CodeStyle/**' + - 'Tools/completion/**' + - 'Tools/debug/**' + - 'Tools/environment_install/**' + - 'Tools/FilterTestTool/**' + - 'Tools/Frame_params/**' + - 'Tools/geotag/**' + - 'Tools/GIT_Test/**' + - 'Tools/gittools/**' + - 'Tools/Hello/**' + - 'Tools/LogAnalyzer/**' + - 'Tools/mavproxy_modules/**' + - 'Tools/Pozyx/**' + - 'Tools/PrintVersion.py' + - 'Tools/Replay/**' + - 'Tools/simulink/**' + - 'Tools/UDP_Proxy/**' + - 'Tools/vagrant/**' + - 'Tools/Vicon/**' + # Remove autotests stuff + - 'Tools/autotest/**' + # 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/**' + + workflow_dispatch: + concurrency: group: ci-${{github.workflow}}-${{ github.ref }} cancel-in-progress: true @@ -11,7 +125,7 @@ concurrency: jobs: build: runs-on: ubuntu-20.04 - container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:latest + container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:v0.0.29 strategy: fail-fast: false # don't cancel if a job from the matrix fails matrix: @@ -29,5 +143,5 @@ jobs: run: | PATH="/usr/lib/ccache:/opt/gcc-arm-none-eabi-${{matrix.gcc}}/bin:$PATH" Tools/scripts/build_tests/test_ccache.py --boards MatekF405,MatekF405-bdshot --min-cache-pct=75 - Tools/scripts/build_tests/test_ccache.py --boards CubeOrange,Durandal --min-cache-pct=75 + Tools/scripts/build_tests/test_ccache.py --boards Durandal,Pixhawk6X --min-cache-pct=73 diff --git a/.github/workflows/test_chibios.yml b/.github/workflows/test_chibios.yml index d6085ac5cb..49006accd0 100644 --- a/.github/workflows/test_chibios.yml +++ b/.github/workflows/test_chibios.yml @@ -1,10 +1,131 @@ name: test chibios -on: [push, pull_request, workflow_dispatch] +on: + push: + branches: + - CxPilot + - master + paths-ignore: + # remove non chibios HAL + - 'libraries/AP_HAL_Linux/**' + - 'libraries/AP_HAL_ESP32/**' + - 'libraries/AP_HAL_SITL/**' + # remove non stm directories + - 'Tools/CHDK-Script/**' + - 'Tools/CodeStyle/**' + - 'Tools/completion/**' + - 'Tools/debug/**' + - 'Tools/environment_install/**' + - 'Tools/FilterTestTool/**' + - 'Tools/Frame_params/**' + - 'Tools/geotag/**' + - 'Tools/GIT_Test/**' + - 'Tools/gittools/**' + - 'Tools/Hello/**' + - 'Tools/LogAnalyzer/**' + - 'Tools/mavproxy_modules/**' + - 'Tools/Pozyx/**' + - 'Tools/PrintVersion.py' + - 'Tools/Replay/**' + - 'Tools/simulink/**' + - 'Tools/UDP_Proxy/**' + - 'Tools/vagrant/**' + - 'Tools/Vicon/**' + # Remove vehicles autotest we need support of test_build_option.py in the Tools/autotest directory + - 'Tools/autotest/antennatracker.py' + - 'Tools/autotest/arduplane.py' + - 'Tools/autotest/ardusub.py' + - 'Tools/autotest/balancebot.py' + - 'Tools/autotest/location.txt' + - 'Tools/autotest/quadplane.py' + - '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/**' + + pull_request: + paths-ignore: + # remove non chibios HAL + - 'libraries/AP_HAL_Linux/**' + - 'libraries/AP_HAL_ESP32/**' + - 'libraries/AP_HAL_SITL/**' + # remove non stm directories + - 'Tools/CHDK-Script/**' + - 'Tools/CodeStyle/**' + - 'Tools/completion/**' + - 'Tools/debug/**' + - 'Tools/environment_install/**' + - 'Tools/FilterTestTool/**' + - 'Tools/Frame_params/**' + - 'Tools/geotag/**' + - 'Tools/GIT_Test/**' + - 'Tools/gittools/**' + - 'Tools/Hello/**' + - 'Tools/LogAnalyzer/**' + - 'Tools/mavproxy_modules/**' + - 'Tools/Pozyx/**' + - 'Tools/PrintVersion.py' + - 'Tools/Replay/**' + - 'Tools/simulink/**' + - 'Tools/UDP_Proxy/**' + - 'Tools/vagrant/**' + - 'Tools/Vicon/**' + # Remove vehicles autotest we need support of test_build_option.py in the Tools/autotest directory + - 'Tools/autotest/antennatracker.py' + - 'Tools/autotest/arduplane.py' + - 'Tools/autotest/ardusub.py' + - 'Tools/autotest/autotest.py' + - 'Tools/autotest/balancebot.py' + - 'Tools/autotest/common.py' + - 'Tools/autotest/examples.py' + - 'Tools/autotest/quadplane.py' + - 'Tools/autotest/rover.py' + - 'Tools/autotest/sailboat.py' + - 'Tools/autotest/**.txt' + - 'Tools/autotest/logger_metadata/**' + - 'Tools/autotest/param_metadata/**' + # 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/**' + + workflow_dispatch: -# paths: -# - "*" -# - "!README.md" <-- don't rebuild on doc change concurrency: group: ci-${{github.workflow}}-${{ github.ref }} cancel-in-progress: true @@ -12,7 +133,7 @@ concurrency: jobs: build: runs-on: ubuntu-20.04 - container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:latest + container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:v0.0.29 strategy: fail-fast: false # don't cancel if a job from the matrix fails matrix: @@ -34,28 +155,13 @@ jobs: signing ] toolchain: [ - chibios, # GCC-6 + chibios, #chibios-clang, ] - gcc: [6, 10] + gcc: [10] exclude: - gcc: 10 toolchain: chibios-clang - - gcc: 6 - config: fmuv2-plane - - gcc: 6 - config: revo-mini - - gcc: 6 - config: MatekF405-Wing - - gcc: 6 - config: periph-build - - gcc: 6 - config: CubeOrange-ODID - - gcc: 6 - config: signing - include: - - config: stm32h7 - toolchain: chibios-py2 steps: # git checkout the PR @@ -67,7 +173,7 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files uses: actions/cache@v3 with: @@ -82,6 +188,7 @@ jobs: CI_BUILD_TARGET: ${{matrix.config}} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} if [[ ${{ matrix.toolchain }} == "chibios-clang" ]]; then export CC=clang export CXX=clang++ diff --git a/.github/workflows/test_environment.yml b/.github/workflows/test_environment.yml index 8d7ba5c87d..126a3e40d9 100644 --- a/.github/workflows/test_environment.yml +++ b/.github/workflows/test_environment.yml @@ -3,6 +3,18 @@ on: schedule: - cron: '0 0 * * 6' # every saturday at midnight workflow_dispatch: + push: + branches: + - CxPilot + - master + paths: + - '.github/workflows/test_environment.yml' + - 'Tools/scripts/environment_install/**' + + pull_request: + paths: + - '.github/workflows/test_environment.yml' + - 'Tools/scripts/environment_install/**' concurrency: @@ -102,6 +114,7 @@ jobs: TZ: Europe/Paris shell: 'script -q -e -c "bash {0}"' run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} source ~/.bashrc git config --global --add safe.directory /__w/ardupilot/ardupilot ./waf configure @@ -114,6 +127,7 @@ jobs: TZ: Europe/Paris shell: 'script -q -e -c "bash {0}"' run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} source ~/.bashrc case ${{matrix.os}} in *"archlinux"*) diff --git a/.github/workflows/test_linux_sbc.yml b/.github/workflows/test_linux_sbc.yml index bb13d48dc7..b44ec5454f 100644 --- a/.github/workflows/test_linux_sbc.yml +++ b/.github/workflows/test_linux_sbc.yml @@ -1,9 +1,132 @@ name: test Linux SBC -on: [push, pull_request, workflow_dispatch] -# paths: -# - "*" -# - "!README.md" <-- don't rebuild on doc change +on: + push: + branches: + - CxPilot + - master + paths-ignore: + # remove non LINUX HAL + - 'libraries/AP_HAL_ChibiOS/**' + - 'libraries/AP_HAL_ESP32/**' + - 'libraries/AP_HAL_SITL/**' + # 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/LogAnalyzer/**' + - 'Tools/mavproxy_modules/**' + - 'Tools/Pozyx/**' + - 'Tools/PrintVersion.py' + - 'Tools/Replay/**' + - 'Tools/simulink/**' + - 'Tools/UDP_Proxy/**' + - 'Tools/vagrant/**' + - 'Tools/Vicon/**' + # Discard file from Tools/scripts as not used + - 'Tools/scripts/build_sizes/**' + - 'Tools/scripts/build_tests/**' + - 'Tools/scripts/CAN/**' + - 'Tools/scripts/signing/**' + # Remove autotests stuff + - 'Tools/autotest/**' + # 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/**' + + pull_request: + paths-ignore: + # remove non LINUX HAL + - 'libraries/AP_HAL_ChibiOS/**' + - 'libraries/AP_HAL_ESP32/**' + - 'libraries/AP_HAL_SITL/**' + # 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/LogAnalyzer/**' + - 'Tools/mavproxy_modules/**' + - '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 autotests stuff + - 'Tools/autotest/**' + # 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/**' + + workflow_dispatch: + concurrency: group: ci-${{github.workflow}}-${{ github.ref }} cancel-in-progress: true @@ -11,7 +134,7 @@ concurrency: jobs: build: runs-on: ubuntu-20.04 - container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:latest + container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:v0.0.29 strategy: fail-fast: false # don't cancel if a job from the matrix fails matrix: @@ -51,13 +174,13 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files uses: actions/cache@v3 with: path: ~/.ccache key: ${{github.workflow}}-ccache-${{matrix.config}}-${{ matrix.toolchain }}-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master + restore-keys: ${{github.workflow}}-ccache-${{matrix.config}}-${{ matrix.toolchain }}- # restore ccache from either previous build on this branch or on master - name: setup ccache run: | . .github/workflows/ccache.env @@ -66,6 +189,7 @@ jobs: CI_BUILD_TARGET: ${{matrix.config}} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} if [[ ${{ matrix.toolchain }} == "clang" ]]; then export CC=clang export CXX=clang++ diff --git a/.github/workflows/test_replay.yml b/.github/workflows/test_replay.yml index 5923527b1b..4a85335e0f 100644 --- a/.github/workflows/test_replay.yml +++ b/.github/workflows/test_replay.yml @@ -1,9 +1,145 @@ name: test replay -on: [push, pull_request, workflow_dispatch] -# paths: -# - "*" -# - "!README.md" <-- don't rebuild on doc change +on: + push: + branches: + - CxPilot + - master + paths-ignore: + # remove other vehicles + - 'AntennaTracker/**' + - 'ArduCopter/**' + - 'ArduPlane/**' + - 'ArduSub/**' + - 'Blimp/**' + - '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/mavproxy_modules/**' + - 'Tools/Pozyx/**' + - 'Tools/PrintVersion.py' + - '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 autotests stuff + - 'Tools/autotest/**' + # 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/**' + + pull_request: + paths-ignore: + # remove other vehicles + - 'AntennaTracker/**' + - 'ArduCopter/**' + - 'ArduPlane/**' + - 'ArduSub/**' + - 'Blimp/**' + - '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/mavproxy_modules/**' + - 'Tools/Pozyx/**' + - 'Tools/PrintVersion.py' + - '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 autotests stuff + - 'Tools/autotest/**' + # 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/**' + + workflow_dispatch: + concurrency: group: ci-${{github.workflow}}-${{ github.ref }} cancel-in-progress: true @@ -11,7 +147,7 @@ concurrency: jobs: build: runs-on: ubuntu-20.04 - container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:latest + container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:v0.0.29 strategy: fail-fast: false # don't cancel if a job from the matrix fails matrix: @@ -32,7 +168,7 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files uses: actions/cache@v3 with: @@ -47,6 +183,7 @@ jobs: CI_BUILD_TARGET: ${{matrix.config}} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} if [[ ${{ matrix.toolchain }} == "clang" ]]; then export CC=clang export CXX=clang++ diff --git a/.github/workflows/test_scripting_docs.yml b/.github/workflows/test_scripting_docs.yml index a281bc459e..2be32b0e9f 100644 --- a/.github/workflows/test_scripting_docs.yml +++ b/.github/workflows/test_scripting_docs.yml @@ -1,15 +1,20 @@ -name: test scripting docs +name: test scripting on: push: + branches: + - CxPilot + - master paths: # only run for scripting changes - 'libraries/AP_Scripting/tests/docs_check.py' - 'libraries/AP_Scripting/generator/**' + - '**.lua' pull_request: paths: # only run for scripting changes - 'libraries/AP_Scripting/tests/docs_check.py' - 'libraries/AP_Scripting/generator/**' + - '**.lua' workflow_dispatch: @@ -18,9 +23,9 @@ concurrency: cancel-in-progress: true jobs: - test-scripting-docs: + test-scripting: runs-on: ubuntu-20.04 - container: ardupilot/ardupilot-dev-base:latest + container: ardupilot/ardupilot-dev-base:v0.0.29 steps: # git checkout the PR - uses: actions/checkout@v3 @@ -35,6 +40,7 @@ jobs: - name: build sitl # we don't really need to build the full code, just trigger docs re-gen with --scripting-docs, timeout after 10 seconds shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} PATH="/github/home/.local/bin:$PATH" ./waf configure --board sitl timeout 10 ./waf antennatracker --scripting-docs || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi diff --git a/.github/workflows/test_sitl_copter.yml b/.github/workflows/test_sitl_copter.yml index 271cb375d0..c22d586db6 100644 --- a/.github/workflows/test_sitl_copter.yml +++ b/.github/workflows/test_sitl_copter.yml @@ -1,9 +1,158 @@ name: test copter -on: [push, pull_request, workflow_dispatch] -# paths: -# - "*" -# - "!README.md" <-- don't rebuild on doc change +on: + push: + branches: + - CxPilot + - master + paths-ignore: + # remove other vehicles + - 'AntennaTracker/**' + - 'ArduPlane/**' + - 'ArduSub/**' + - 'Blimp/**' + - '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/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/arduplane.py' + - 'Tools/autotest/ardusub.py' + - 'Tools/autotest/balancebot.py' + - 'Tools/autotest/location.txt' + - 'Tools/autotest/quadplane.py' + - '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/**' + + + pull_request: + paths-ignore: + # remove other vehicles + - 'AntennaTracker/**' + - 'ArduPlane/**' + - 'ArduSub/**' + - 'Blimp/**' + - '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/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/arduplane.py' + - 'Tools/autotest/ardusub.py' + - 'Tools/autotest/balancebot.py' + - 'Tools/autotest/location.txt' + - 'Tools/autotest/quadplane.py' + - '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/**' + + workflow_dispatch: + concurrency: group: ci-${{github.workflow}}-${{ github.ref }} cancel-in-progress: true @@ -11,7 +160,7 @@ concurrency: jobs: build: runs-on: ubuntu-20.04 - container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:latest + container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:v0.0.29 strategy: fail-fast: false # don't cancel if a job from the matrix fails matrix: @@ -29,7 +178,7 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files uses: actions/cache@v3 with: @@ -42,6 +191,7 @@ jobs: - name: build copter ${{ matrix.toolchain }} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} if [[ ${{ matrix.toolchain }} == "clang" ]]; then export CC=clang export CXX=clang++ @@ -56,7 +206,7 @@ jobs: needs: build # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build runs-on: ubuntu-20.04 container: - image: ardupilot/ardupilot-dev-base:latest + image: ardupilot/ardupilot-dev-base:v0.0.29 options: --privileged --cap-add=SYS_PTRACE --security-opt apparmor=unconfined --security-opt seccomp=unconfined strategy: fail-fast: false # don't cancel if a job from the matrix fails @@ -81,9 +231,9 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: ~/.ccache key: ${{github.workflow}}-ccache-base-${{steps.ccache_cache_timestamp.outputs.timestamp}} @@ -96,6 +246,7 @@ jobs: CI_BUILD_TARGET: ${{matrix.config}} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} PATH="/github/home/.local/bin:$PATH" Tools/scripts/build_ci.sh @@ -123,7 +274,7 @@ jobs: build-gcc-heli: runs-on: ubuntu-20.04 container: - image: ardupilot/ardupilot-dev-base:latest + image: ardupilot/ardupilot-dev-base:v0.0.29 options: --privileged --cap-add=SYS_PTRACE --security-opt apparmor=unconfined --security-opt seccomp=unconfined steps: # git checkout the PR @@ -135,7 +286,7 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files uses: actions/cache@v3 with: @@ -148,6 +299,7 @@ jobs: - name: build heli shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} PATH="/github/home/.local/bin:$PATH" ./waf configure --board sitl ./waf build --target bin/arducopter-heli @@ -157,7 +309,7 @@ jobs: autotest-heli: needs: build-gcc-heli # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build runs-on: ubuntu-20.04 - container: ardupilot/ardupilot-dev-base:latest + container: ardupilot/ardupilot-dev-base:v0.0.29 strategy: fail-fast: false # don't cancel if a job from the matrix fails matrix: @@ -175,9 +327,9 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: ~/.ccache key: ${{github.workflow}}-ccache-base-${{steps.ccache_cache_timestamp.outputs.timestamp}} @@ -190,6 +342,7 @@ jobs: CI_BUILD_TARGET: ${{matrix.config}} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} PATH="/github/home/.local/bin:$PATH" Tools/scripts/build_ci.sh diff --git a/.github/workflows/test_sitl_periph.yml b/.github/workflows/test_sitl_periph.yml index b236cfcc28..f26d3e7b76 100644 --- a/.github/workflows/test_sitl_periph.yml +++ b/.github/workflows/test_sitl_periph.yml @@ -1,9 +1,157 @@ name: test ap_periph -on: [push, pull_request, workflow_dispatch] -# paths: -# - "*" -# - "!README.md" <-- don't rebuild on doc change +on: + push: + branches: + - CxPilot + - master + paths-ignore: + # remove other vehicles than copter + - 'AntennaTracker/**' + - 'ArduPlane/**' + - 'ArduSub/**' + - 'Blimp/**' + - 'Rover/**' + # remove non SITL HAL + - 'libraries/AP_HAL_ChibiOS/**' + - 'libraries/AP_HAL_ESP32/**' + # remove non SITL directories + - '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 keep only coptertest + - 'Tools/autotest/antennatracker.py' + - 'Tools/autotest/arduplane.py' + - 'Tools/autotest/ardusub.py' + - 'Tools/autotest/balancebot.py' + - 'Tools/autotest/helicopter.py' + - 'Tools/autotest/location.txt' + - 'Tools/autotest/quadplane.py' + - '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/**' + + pull_request: + paths-ignore: + # remove other vehicles than copter + - 'AntennaTracker/**' + - 'ArduPlane/**' + - 'ArduSub/**' + - 'Blimp/**' + - 'Rover/**' + # remove non SITL HAL + - 'libraries/AP_HAL_ChibiOS/**' + - 'libraries/AP_HAL_ESP32/**' + # remove non SITL directories + - '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 keep only coptertest + - 'Tools/autotest/antennatracker.py' + - 'Tools/autotest/arduplane.py' + - 'Tools/autotest/ardusub.py' + - 'Tools/autotest/balancebot.py' + - 'Tools/autotest/helicopter.py' + - 'Tools/autotest/location.txt' + - 'Tools/autotest/quadplane.py' + - '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/**' + + workflow_dispatch: + concurrency: group: ci-${{github.workflow}}-${{ github.ref }} cancel-in-progress: true @@ -11,7 +159,7 @@ concurrency: jobs: build-gcc-ap_periph: runs-on: ubuntu-20.04 - container: ardupilot/ardupilot-dev-base:latest + container: ardupilot/ardupilot-dev-periph:v0.0.29 steps: # git checkout the PR - uses: actions/checkout@v3 @@ -22,7 +170,7 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files uses: actions/cache@v3 with: @@ -32,11 +180,6 @@ jobs: - name: setup ccache run: | . .github/workflows/ccache.env - - name: install 32-bit libraries - run: | - dpkg --add-architecture i386 - apt-get update - apt-get install -y gcc-multilib g++-multilib - name: run dronecan dsdlc generator test run: | @@ -46,6 +189,7 @@ jobs: - name: build sitl_periph_gps shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} PATH="/github/home/.local/bin:$PATH" ./waf configure --board sitl_periph_gps ./waf build --target bin/AP_Periph @@ -56,7 +200,7 @@ jobs: needs: build-gcc-ap_periph # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build runs-on: ubuntu-20.04 container: - image: ardupilot/ardupilot-dev-base:latest + image: ardupilot/ardupilot-dev-periph:v0.0.29 options: --privileged strategy: fail-fast: false # don't cancel if a job from the matrix fails @@ -75,7 +219,7 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files uses: actions/cache@v3 with: @@ -85,11 +229,6 @@ jobs: - name: setup ccache run: | . .github/workflows/ccache.env - - name: install 32-bit libraries - run: | - sudo dpkg --add-architecture i386 - sudo apt-get update - sudo apt-get install -y gcc-multilib g++-multilib - name: setup can-utils run: | kernel_ver=`uname -r` @@ -104,6 +243,7 @@ jobs: CI_BUILD_TARGET: ${{matrix.config}} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} kernel_ver=`uname -r` if [ "$kernel_ver" = "5.4.0-1032-azure" ] || [ "$kernel_ver" = "5.11.4-051104-generic" ]; then echo "Unsupported Kernel $kernel_ver" && exit 0; fi; PATH="/github/home/.local/bin:$PATH" diff --git a/.github/workflows/test_sitl_plane.yml b/.github/workflows/test_sitl_plane.yml index e1903669b8..a91cf72735 100644 --- a/.github/workflows/test_sitl_plane.yml +++ b/.github/workflows/test_sitl_plane.yml @@ -1,9 +1,159 @@ name: test plane -on: [push, pull_request, workflow_dispatch] -# paths: -# - "*" -# - "!README.md" <-- don't rebuild on doc change +on: + push: + branches: + - CxPilot + - master + paths-ignore: + # remove other vehicles + - 'AntennaTracker/**' + - 'ArduCopter/**' + - 'ArduSub/**' + - 'Blimp/**' + - '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/**' + + pull_request: + paths-ignore: + # remove other vehicles + - 'AntennaTracker/**' + - 'ArduCopter/**' + - 'ArduSub/**' + - 'Blimp/**' + - '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/**' + + workflow_dispatch: + concurrency: group: ci-${{github.workflow}}-${{ github.ref }} cancel-in-progress: true @@ -11,7 +161,7 @@ concurrency: jobs: build: runs-on: ubuntu-20.04 - container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:latest + container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:v0.0.29 strategy: fail-fast: false # don't cancel if a job from the matrix fails matrix: @@ -29,7 +179,7 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files uses: actions/cache@v3 with: @@ -42,6 +192,7 @@ jobs: - name: build plane ${{ matrix.toolchain }} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} if [[ ${{ matrix.toolchain }} == "clang" ]]; then export CC=clang export CXX=clang++ @@ -56,7 +207,7 @@ jobs: needs: build # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build runs-on: ubuntu-20.04 container: - image: ardupilot/ardupilot-dev-base:latest + image: ardupilot/ardupilot-dev-base:v0.0.29 options: --privileged --cap-add=SYS_PTRACE --security-opt apparmor=unconfined --security-opt seccomp=unconfined strategy: fail-fast: false # don't cancel if a job from the matrix fails @@ -76,9 +227,9 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: ~/.ccache key: ${{github.workflow}}-ccache-base-${{steps.ccache_cache_timestamp.outputs.timestamp}} @@ -91,6 +242,7 @@ jobs: CI_BUILD_TARGET: ${{matrix.config}} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} PATH="/github/home/.local/bin:$PATH" Tools/scripts/build_ci.sh diff --git a/.github/workflows/test_sitl_rover.yml b/.github/workflows/test_sitl_rover.yml index 98751a4c6a..c519164478 100644 --- a/.github/workflows/test_sitl_rover.yml +++ b/.github/workflows/test_sitl_rover.yml @@ -1,9 +1,158 @@ name: test rover -on: [push, pull_request, workflow_dispatch] -# paths: -# - "*" -# - "!README.md" <-- don't rebuild on doc change +on: + push: + branches: + - CxPilot + - master + paths-ignore: + # remove other vehicles + - 'AntennaTracker/**' + - 'ArduCopter/**' + - 'ArduPlane/**' + - 'ArduSub/**' + - 'Blimp/**' + # 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/arduplane.py' + - 'Tools/autotest/ardusub.py' + - 'Tools/autotest/helicopter.py' + - 'Tools/autotest/location.txt' + - 'Tools/autotest/quadplane.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/**' + + + pull_request: + paths-ignore: + # remove other vehicles + - 'AntennaTracker/**' + - 'ArduCopter/**' + - 'ArduPlane/**' + - 'ArduSub/**' + - 'Blimp/**' + # 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/arduplane.py' + - 'Tools/autotest/ardusub.py' + - 'Tools/autotest/helicopter.py' + - 'Tools/autotest/location.txt' + - 'Tools/autotest/quadplane.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/**' + + workflow_dispatch: + concurrency: group: ci-${{github.workflow}}-${{ github.ref }} cancel-in-progress: true @@ -11,7 +160,7 @@ concurrency: jobs: build: runs-on: ubuntu-20.04 - container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:latest + container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:v0.0.29 strategy: fail-fast: false # don't cancel if a job from the matrix fails matrix: @@ -29,7 +178,7 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files uses: actions/cache@v3 with: @@ -42,6 +191,7 @@ jobs: - name: build rover ${{ matrix.toolchain }} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} if [[ ${{ matrix.toolchain }} == "clang" ]]; then export CC=clang export CXX=clang++ @@ -56,7 +206,7 @@ jobs: needs: build # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build runs-on: ubuntu-20.04 container: - image: ardupilot/ardupilot-dev-base:latest + image: ardupilot/ardupilot-dev-base:v0.0.29 options: --privileged --cap-add=SYS_PTRACE --security-opt apparmor=unconfined --security-opt seccomp=unconfined strategy: fail-fast: false # don't cancel if a job from the matrix fails @@ -77,9 +227,9 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: ~/.ccache key: ${{github.workflow}}-ccache-base-${{steps.ccache_cache_timestamp.outputs.timestamp}} @@ -92,6 +242,7 @@ jobs: CI_BUILD_TARGET: ${{matrix.config}} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} PATH="/github/home/.local/bin:$PATH" Tools/scripts/build_ci.sh diff --git a/.github/workflows/test_sitl_sub.yml b/.github/workflows/test_sitl_sub.yml index c5685ce3e0..04eaf44c50 100644 --- a/.github/workflows/test_sitl_sub.yml +++ b/.github/workflows/test_sitl_sub.yml @@ -1,9 +1,161 @@ name: test sub -on: [push, pull_request, workflow_dispatch] -# paths: -# - "*" -# - "!README.md" <-- don't rebuild on doc change +on: + push: + branches: + - CxPilot + - master + paths-ignore: + # remove other vehicles + - 'AntennaTracker/**' + - 'ArduCopter/**' + - 'ArduPlane/**' + - 'Blimp/**' + - '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/arduplane.py' + - 'Tools/autotest/balancebot.py' + - 'Tools/autotest/helicopter.py' + - 'Tools/autotest/location.txt' + - 'Tools/autotest/quadplane.py' + - '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/**' + + pull_request: + paths-ignore: + # remove other vehicles + - 'AntennaTracker/**' + - 'ArduCopter/**' + - 'ArduPlane/**' + - 'Blimp/**' + - '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/arduplane.py' + - 'Tools/autotest/balancebot.py' + - 'Tools/autotest/helicopter.py' + - 'Tools/autotest/location.txt' + - 'Tools/autotest/quadplane.py' + - '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/**' + + workflow_dispatch: + concurrency: group: ci-${{github.workflow}}-${{ github.ref }} cancel-in-progress: true @@ -11,7 +163,7 @@ concurrency: jobs: build: runs-on: ubuntu-20.04 - container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:latest + container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:v0.0.29 strategy: fail-fast: false # don't cancel if a job from the matrix fails matrix: @@ -29,7 +181,7 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files uses: actions/cache@v3 with: @@ -42,6 +194,7 @@ jobs: - name: build sub ${{ matrix.toolchain }} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} if [[ ${{ matrix.toolchain }} == "clang" ]]; then export CC=clang export CXX=clang++ @@ -56,7 +209,7 @@ jobs: needs: build # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build runs-on: ubuntu-20.04 container: - image: ardupilot/ardupilot-dev-base:latest + image: ardupilot/ardupilot-dev-base:v0.0.29 options: --privileged --cap-add=SYS_PTRACE --security-opt apparmor=unconfined --security-opt seccomp=unconfined strategy: fail-fast: false # don't cancel if a job from the matrix fails @@ -75,9 +228,9 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: ~/.ccache key: ${{github.workflow}}-ccache-base-${{steps.ccache_cache_timestamp.outputs.timestamp}} @@ -90,6 +243,7 @@ jobs: CI_BUILD_TARGET: ${{matrix.config}} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} PATH="/github/home/.local/bin:$PATH" Tools/scripts/build_ci.sh diff --git a/.github/workflows/test_sitl_tracker.yml b/.github/workflows/test_sitl_tracker.yml index 3ded077b4d..81307adf5d 100644 --- a/.github/workflows/test_sitl_tracker.yml +++ b/.github/workflows/test_sitl_tracker.yml @@ -1,9 +1,161 @@ name: test tracker -on: [push, pull_request, workflow_dispatch] -# paths: -# - "*" -# - "!README.md" <-- don't rebuild on doc change +on: + push: + branches: + - CxPilot + - master + paths-ignore: + # remove other vehicles + - 'ArduCopter/**' + - 'ArduPlane/**' + - 'ArduSub/**' + - 'Blimp/**' + - '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/arducopter.py' + - 'Tools/autotest/arduplane.py' + - 'Tools/autotest/ardusub.py' + - 'Tools/autotest/balancebot.py' + - 'Tools/autotest/helicopter.py' + - 'Tools/autotest/location.txt' + - 'Tools/autotest/quadplane.py' + - '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/**' + + pull_request: + paths-ignore: + # remove other vehicles + - 'ArduCopter/**' + - 'ArduPlane/**' + - 'ArduSub/**' + - 'Blimp/**' + - '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/arducopter.py' + - 'Tools/autotest/arduplane.py' + - 'Tools/autotest/ardusub.py' + - 'Tools/autotest/balancebot.py' + - 'Tools/autotest/helicopter.py' + - 'Tools/autotest/location.txt' + - 'Tools/autotest/quadplane.py' + - '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/**' + + workflow_dispatch: + concurrency: group: ci-${{github.workflow}}-${{ github.ref }} cancel-in-progress: true @@ -11,7 +163,7 @@ concurrency: jobs: build: runs-on: ubuntu-20.04 - container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:latest + container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:v0.0.29 strategy: fail-fast: false # don't cancel if a job from the matrix fails matrix: @@ -29,7 +181,7 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files uses: actions/cache@v3 with: @@ -42,6 +194,7 @@ jobs: - name: build tracker ${{ matrix.toolchain }} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} if [[ ${{ matrix.toolchain }} == "clang" ]]; then export CC=clang export CXX=clang++ @@ -56,7 +209,7 @@ jobs: needs: build # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build runs-on: ubuntu-20.04 container: - image: ardupilot/ardupilot-dev-base:latest + image: ardupilot/ardupilot-dev-base:v0.0.29 options: --privileged --cap-add=SYS_PTRACE --security-opt apparmor=unconfined --security-opt seccomp=unconfined strategy: fail-fast: false # don't cancel if a job from the matrix fails @@ -75,9 +228,9 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: ~/.ccache key: ${{github.workflow}}-ccache-base-${{steps.ccache_cache_timestamp.outputs.timestamp}} @@ -90,6 +243,7 @@ jobs: CI_BUILD_TARGET: ${{matrix.config}} shell: bash run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} PATH="/github/home/.local/bin:$PATH" Tools/scripts/build_ci.sh diff --git a/.github/workflows/test_size.yml b/.github/workflows/test_size.yml index e576606291..2470a9b722 100644 --- a/.github/workflows/test_size.yml +++ b/.github/workflows/test_size.yml @@ -1,9 +1,57 @@ name: test size -on: [pull_request] -# paths: -# - "*" -# - "!README.md" <-- don't rebuild on doc change +on: + pull_request: + paths-ignore: # ignore autotest stuffs + - 'Tools/autotest/**' + # 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/**' + # Remove generic tools + - 'Tools/CHDK-Script/**' + - 'Tools/CodeStyle/**' + - 'Tools/completion/**' + - 'Tools/CPUInfo/**' + - 'Tools/debug/**' + - 'Tools/environment_install/**' + - 'Tools/FilterTestTool/**' + - 'Tools/geotag/**' + - 'Tools/GIT_Test/**' + - 'Tools/gittools/**' + - 'Tools/Hello/**' + - 'Tools/Linux_HAL_Essentials/**' + - 'Tools/LogAnalyzer/**' + - 'Tools/mavproxy_modules/**' + - 'Tools/Pozyx/**' + - 'Tools/PrintVersion.py' + - 'Tools/simulink/**' + - 'Tools/UDP_Proxy/**' + - 'Tools/vagrant/**' + - 'Tools/Vicon/**' + # remove non CHIBIOS HAL + - 'libraries/AP_HAL_SITL/**' + - 'libraries/AP_HAL_ESP32/**' + - 'libraries/AP_HAL_Linux/**' + workflow_dispatch: + + concurrency: group: ci-${{github.workflow}}-${{ github.ref }} cancel-in-progress: true @@ -11,12 +59,12 @@ concurrency: jobs: build: runs-on: ubuntu-20.04 - container: ardupilot/ardupilot-dev-chibios:latest + container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:v0.0.29 strategy: fail-fast: false # don't cancel if a job from the matrix fails matrix: toolchain: [ - base, # GCC + chibios, ] config: [ Durandal, @@ -36,7 +84,7 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files uses: actions/cache@v3 with: diff --git a/.github/workflows/test_unit_tests.yml b/.github/workflows/test_unit_tests.yml index 0dad924a80..329a4c2a62 100644 --- a/.github/workflows/test_unit_tests.yml +++ b/.github/workflows/test_unit_tests.yml @@ -1,9 +1,97 @@ -name: test unit tests and Python cleanliness +name: test unit tests and sitl building + +on: + push: + branches: + - CxPilot + - master + paths-ignore: + # Remove markdown files as irrelevant + - '**.md' + # Remove dotfile at root directory + - './.dir-locals.el' + - './.dockerignore' + - './.editorconfig' + - './.gitattributes' + - './.github' + - './.gitignore' + - './.valgrind-suppressions' + - './.valgrindrc' + - 'Dockerfile' + - 'Vagrantfile' + - 'Makefile' + # Remove some directories check + - '.vscode/**' + - '.github/ISSUE_TEMPLATE/**' + # Remove generic tools + - 'Tools/CHDK-Script/**' + - 'Tools/CodeStyle/**' + - 'Tools/completion/**' + - 'Tools/CPUInfo/**' + - 'Tools/debug/**' + - 'Tools/environment_install/**' + - 'Tools/FilterTestTool/**' + - 'Tools/geotag/**' + - 'Tools/GIT_Test/**' + - 'Tools/gittools/**' + - 'Tools/Hello/**' + - 'Tools/Linux_HAL_Essentials/**' + - 'Tools/LogAnalyzer/**' + - 'Tools/mavproxy_modules/**' + - 'Tools/Pozyx/**' + - 'Tools/PrintVersion.py' + - 'Tools/simulink/**' + - 'Tools/UDP_Proxy/**' + - 'Tools/vagrant/**' + - 'Tools/Vicon/**' + # remove non SITL HAL + - 'libraries/AP_HAL_ChibiOS/**' + - 'libraries/AP_HAL_ESP32/**' + pull_request: + paths-ignore: + # Remove markdown files as irrelevant + - '**.md' + # Remove dotfile at root directory + - './.dir-locals.el' + - './.dockerignore' + - './.editorconfig' + - './.gitattributes' + - './.github' + - './.gitignore' + - './.valgrind-suppressions' + - './.valgrindrc' + - 'Dockerfile' + - 'Vagrantfile' + - 'Makefile' + # Remove some directories check + - '.vscode/**' + - '.github/ISSUE_TEMPLATE/**' + # Remove generic tools + - 'Tools/CHDK-Script/**' + - 'Tools/CPUInfo/**' + - 'Tools/CodeStyle/**' + - 'Tools/FilterTestTool/**' + - 'Tools/GIT_Test/**' + - 'Tools/Hello/**' + - 'Tools/Linux_HAL_Essentials/**' + - 'Tools/LogAnalyzer/**' + - 'Tools/Pozyx/**' + - 'Tools/PrintVersion.py' + - 'Tools/completion/**' + - 'Tools/debug/**' + - 'Tools/environment_install/**' + - 'Tools/geotag/**' + - 'Tools/gittools/**' + - 'Tools/mavproxy_modules/**' + - 'Tools/simulink/**' + - 'Tools/vagrant/**' + - 'Tools/UDP_Proxy/**' + - 'Tools/Vicon/**' + # remove non SITL HAL + - 'libraries/AP_HAL_ChibiOS/**' + - 'libraries/AP_HAL_ESP32/**' + workflow_dispatch: -on: [push, pull_request, workflow_dispatch] -# paths: -# - "*" -# - "!README.md" <-- don't rebuild on doc change concurrency: group: ci-${{github.workflow}}-${{ github.ref }} cancel-in-progress: true @@ -23,7 +111,6 @@ jobs: ] config: [ unit-tests, - # python-cleanliness, # DISABLED for 4.3.x sitl # examples, ] @@ -37,7 +124,7 @@ jobs: id: ccache_cache_timestamp run: | NOW=$(date -u +"%F-%T") - echo "{timestamp}=${NOW}" >> $GITHUB_OUTPUT + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT - name: ccache cache files uses: actions/cache@v3 with: @@ -52,6 +139,7 @@ jobs: CI_BUILD_TARGET: ${{matrix.config}} shell: 'script -q -e -c "bash {0}"' run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} if [[ ${{ matrix.toolchain }} == "clang" ]]; then export CC=clang export CXX=clang++