-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lokesh Ramina
committed
Sep 25, 2023
1 parent
f59ddcc
commit f4b4074
Showing
1 changed file
with
196 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,205 @@ | ||
name: Carbonix ArduPilot Build and Release | ||
name: Carbonix Test plane | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
on: | ||
push: | ||
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/**' | ||
# Remove change on other workflows | ||
- '.github/workflows/test_environment.yml' | ||
|
||
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/**' | ||
# Remove change on other workflows | ||
- '.github/workflows/test_environment.yml' | ||
|
||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ci-${{github.workflow}}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-and-release: | ||
runs-on: ubuntu-20.04 | ||
|
||
build: | ||
runs-on: ubuntu-22.04 | ||
container: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:v0.1.0 | ||
strategy: | ||
fail-fast: false # don't cancel if a job from the matrix fails | ||
matrix: | ||
toolchain: [ | ||
base, # GCC | ||
clang, | ||
] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
# git checkout the PR | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: test install environment | ||
timeout-minutes: 30 | ||
env: | ||
DISABLE_MAVNATIVE: True | ||
DEBIAN_FRONTEND: noninteractive | ||
TZ: Europe/Paris | ||
SKIP_AP_GIT_CHECK: 1 | ||
shell: 'script -q -e -c "bash {0}"' | ||
run: | | ||
PATH="/github/home/.local/bin:$PATH" | ||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
sed -i 's/\$EUID/\$ID/' Tools/environment_install/install-prereqs-ubuntu.sh | ||
sed -i 's/sudo usermod/\#sudo usermod/' Tools/environment_install/install-prereqs-ubuntu.sh | ||
sed -i 's/sudo usermod/\#sudo usermod/' Tools/environment_install/install-prereqs-arch.sh | ||
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections | ||
Tools/environment_install/install-prereqs-ubuntu.sh -qy | ||
Tools/environment_install/install-prereqs-ubuntu.sh -qy | ||
cp /etc/skel/.bashrc /root | ||
cp /etc/skel/.bashrc /github/home | ||
Tools/environment_install/install-prereqs-arch.sh -qy | ||
esac | ||
- name: Build for STIL | ||
env: | ||
DISABLE_MAVNATIVE: True | ||
DEBIAN_FRONTEND: noninteractive | ||
TZ: Europe/Paris | ||
shell: 'script -q -e -c "bash {0}"' | ||
run: | | ||
source ~/.bashrc | ||
./waf configure | ||
./waf plane | ||
- name: Build for CubeOrange | ||
env: | ||
DISABLE_MAVNATIVE: True | ||
DEBIAN_FRONTEND: noninteractive | ||
TZ: Europe/Paris | ||
shell: 'script -q -e -c "bash {0}"' | ||
run: | | ||
source ~/.bashrc | ||
./waf configure --board CubeOrange | ||
./waf plane | ||
- name: Build for CarbonixF405 | ||
env: | ||
DISABLE_MAVNATIVE: True | ||
DEBIAN_FRONTEND: noninteractive | ||
TZ: Europe/Paris | ||
shell: 'script -q -e -c "bash {0}"' | ||
run: | | ||
source ~/.bashrc | ||
./waf configure --board CarbonixF405 | ||
./waf AP_Periph | ||
- name: Create Release Zip | ||
run: | | ||
cd carbopilot_V2/build/CubeOrange | ||
zip -r CubeOrange_binaries.zip . | ||
mv CubeOrange_binaries.zip $GITHUB_WORKSPACE | ||
cd ../CarbonixF405 | ||
zip -r CarbonixF405_binaries.zip . | ||
mv CarbonixF405_binaries.zip $GITHUB_WORKSPACE | ||
- name: Upload Release Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ArduPilot-Binaries | ||
path: | | ||
$GITHUB_WORKSPACE/CubeOrange_binaries.zip | ||
$GITHUB_WORKSPACE/CarbonixF405_binaries.zip | ||
# Put ccache into github cache for faster build | ||
- name: Prepare ccache timestamp | ||
id: ccache_cache_timestamp | ||
run: | | ||
NOW=$(date -u +"%F-%T") | ||
echo "timestamp=${NOW}" >> $GITHUB_OUTPUT | ||
- name: ccache cache files | ||
uses: actions/cache@v3 | ||
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: | | ||
. .github/workflows/ccache.env | ||
- 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++ | ||
fi | ||
PATH="/github/home/.local/bin:$PATH" | ||
./waf configure --board sitl | ||
./waf build --target bin/arduplane | ||
ccache -s | ||
ccache -z |