Skip to content

Commit

Permalink
ci: build targets using px4-dev container
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpollo committed Nov 22, 2024
1 parent 233cf17 commit 24ede0c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 25 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/build_all_targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ jobs:
with:
fetch-depth: 0

- name: Install ccache
run: |
apt-get --quiet -y update && DEBIAN_FRONTEND=noninteractive apt-get --quiet -y install \
ccache
- name: Git ownership workaround
run: git config --system --add safe.directory '*'

Expand All @@ -108,9 +113,16 @@ jobs:
ccache -s
ccache -z
- name: Missing dependencies for ${{ matrix.arch }}
if: contains(fromJSON('["aarch64", "armhf"]'), matrix.arch)
run: |
apt-get --quiet -y update && DEBIAN_FRONTEND=noninteractive apt-get --quiet -y install \
g++-aarch64-linux-gnu \
g++-arm-linux-gnueabihf
- name: Building [${{ matrix.group }}]
run: |
./Tools/ci/build_all_runner.sh ${{matrix.targets}}
./Tools/ci/build_all_runner.sh ${{matrix.targets}} ${{matrix.arch}}
- name: Arrange Build Artifacts
run: |
Expand Down
7 changes: 2 additions & 5 deletions Tools/ci/generate_board_targets_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,17 @@ def process_target(px4board_file, target_name):

if platform not in excluded_platforms:
# get the container based on the platform and toolchain
container = 'ghcr.io/px4/px4-dev:main'
if platform == 'posix':
container = 'px4io/px4-dev-base-focal:2021-09-08'
group = 'base'
if toolchain:
if toolchain.startswith('aarch64'):
container = 'px4io/px4-dev-aarch64:2022-08-12'
group = 'aarch64'
elif toolchain == 'arm-linux-gnueabihf':
container = 'px4io/px4-dev-armhf:2023-06-26'
group = 'armhf'
else:
if verbose: print(f'unmatched toolchain: {toolchain}')
elif platform == 'nuttx':
container = 'px4io/px4-dev-nuttx-focal:2022-08-12'
group = 'nuttx'
else:
if verbose: print(f'unmatched platform: {platform}')
Expand All @@ -124,7 +121,7 @@ def process_target(px4board_file, target_name):
# - Events
metadata_targets = ['airframe_metadata', 'parameters_metadata', 'extract_events']
grouped_targets['base'] = {}
grouped_targets['base']['container'] = 'px4io/px4-dev-base-focal:2021-09-08'
grouped_targets['base']['container'] = 'ghcr.io/px4/px4-dev:main'
grouped_targets['base']['manufacturers'] = {}
grouped_targets['base']['manufacturers']['px4'] = []
grouped_targets['base']['manufacturers']['px4'] += metadata_targets
Expand Down
41 changes: 22 additions & 19 deletions Tools/ci/package_build_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ mkdir artifacts
cp **/**/*.px4 artifacts/
cp **/**/*.elf artifacts/
for build_dir_path in build/*/ ; do
build_dir_path=${build_dir_path::${#build_dir_path}-1}
build_dir=${build_dir_path#*/}
build_dir=${build_dir::${#build_dir}-1}
target_name=$build_dir
mkdir artifacts/$build_dir
find artifacts/ -maxdepth 1 -type f -name "*$build_dir*"
# Airframe
Expand All @@ -26,21 +27,23 @@ for build_dir_path in build/*/ ; do
echo "----------"
done

# general metadata
mkdir artifacts/_general/
cp artifacts/px4_sitl_default/airframes.xml artifacts/_general/
# Airframe
cp artifacts/px4_sitl_default/airframes.xml artifacts/_general/
# Parameters
cp artifacts/px4_sitl_default/parameters.xml artifacts/_general/
cp artifacts/px4_sitl_default/parameters.json artifacts/_general/
cp artifacts/px4_sitl_default/parameters.json.xz artifacts/_general/
# Actuators
cp artifacts/px4_sitl_default/actuators.json artifacts/_general/
cp artifacts/px4_sitl_default/actuators.json.xz artifacts/_general/
# Events
cp artifacts/px4_sitl_default/events/all_events.json.xz artifacts/_general/
# ROS 2 msgs
cp artifacts/px4_sitl_default/events/all_events.json.xz artifacts/_general/
# Module Docs
ls -la artifacts/_general/
if [ -d artifacts/px4_sitl_default ]; then
# general metadata
mkdir artifacts/_general/
cp artifacts/px4_sitl_default/airframes.xml artifacts/_general/
# Airframe
cp artifacts/px4_sitl_default/airframes.xml artifacts/_general/
# Parameters
cp artifacts/px4_sitl_default/parameters.xml artifacts/_general/
cp artifacts/px4_sitl_default/parameters.json artifacts/_general/
cp artifacts/px4_sitl_default/parameters.json.xz artifacts/_general/
# Actuators
cp artifacts/px4_sitl_default/actuators.json artifacts/_general/
cp artifacts/px4_sitl_default/actuators.json.xz artifacts/_general/
# Events
cp artifacts/px4_sitl_default/events/all_events.json.xz artifacts/_general/
# ROS 2 msgs
cp artifacts/px4_sitl_default/events/all_events.json.xz artifacts/_general/
# Module Docs
ls -la artifacts/_general/
fi

0 comments on commit 24ede0c

Please sign in to comment.