From 93b6f72bb0afe809c9acbdd80c7b1858395ae771 Mon Sep 17 00:00:00 2001 From: Ramon Roche Date: Thu, 21 Nov 2024 17:12:29 -0800 Subject: [PATCH] ci: build targets using px4-dev container --- .github/workflows/build_all_targets.yml | 14 ++++++++- Tools/ci/generate_board_targets_json.py | 7 ++--- Tools/ci/package_build_artifacts.sh | 41 +++++++++++++------------ 3 files changed, 37 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build_all_targets.yml b/.github/workflows/build_all_targets.yml index e6d0ece2897a..db6d572e4fb5 100644 --- a/.github/workflows/build_all_targets.yml +++ b/.github/workflows/build_all_targets.yml @@ -71,6 +71,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 '*' @@ -92,9 +97,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: | diff --git a/Tools/ci/generate_board_targets_json.py b/Tools/ci/generate_board_targets_json.py index c5c86f782fb4..67e792154886 100755 --- a/Tools/ci/generate_board_targets_json.py +++ b/Tools/ci/generate_board_targets_json.py @@ -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}') @@ -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 diff --git a/Tools/ci/package_build_artifacts.sh b/Tools/ci/package_build_artifacts.sh index a665e295df71..2b487f7632e3 100755 --- a/Tools/ci/package_build_artifacts.sh +++ b/Tools/ci/package_build_artifacts.sh @@ -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 @@ -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