Skip to content

Commit 9df21ef

Browse files
authored
Merge branch 'main' into ins_fix
2 parents fbd8f1e + 76fd84d commit 9df21ef

302 files changed

Lines changed: 9412 additions & 8766 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/build-deb/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ runs:
2020
steps:
2121
- name: Restore ccache
2222
id: ccache-restore
23-
uses: actions/cache/restore@v4
23+
uses: actions/cache/restore@v5
2424
with:
2525
path: ~/.ccache
2626
key: ${{ inputs.ccache-key-prefix }}-${{ github.ref_name }}-${{ github.sha }}
@@ -52,7 +52,7 @@ runs:
5252
run: ccache -s
5353

5454
- name: Save ccache
55-
uses: actions/cache/save@v4
55+
uses: actions/cache/save@v5
5656
if: always()
5757
with:
5858
path: ~/.ccache
@@ -108,7 +108,7 @@ runs:
108108
echo "PASS: gazebo package validation successful"
109109
110110
- name: Upload .deb artifacts
111-
uses: actions/upload-artifact@v4
111+
uses: actions/upload-artifact@v7
112112
with:
113113
name: ${{ inputs.artifact-name }}
114114
path: build/px4_sitl_${{ inputs.target }}/*.deb
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build Gazebo Classic SITL
2+
description: Build PX4 firmware and Gazebo Classic plugins with ccache stats
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Build - PX4 Firmware (SITL)
8+
shell: bash
9+
run: make px4_sitl_default
10+
11+
- name: Cache - Stats after PX4 Firmware
12+
shell: bash
13+
run: ccache -s
14+
15+
- name: Build - Gazebo Classic Plugins
16+
shell: bash
17+
run: make px4_sitl_default sitl_gazebo-classic
18+
19+
- name: Cache - Stats after Gazebo Plugins
20+
shell: bash
21+
run: ccache -s
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Save ccache
2+
description: Print ccache stats and save to cache
3+
4+
inputs:
5+
cache-primary-key:
6+
description: Primary cache key from setup-ccache output
7+
required: true
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Cache - Stats
13+
if: always()
14+
shell: bash
15+
run: ccache -s
16+
17+
- name: Cache - Save ccache
18+
if: always()
19+
uses: actions/cache/save@v5
20+
with:
21+
path: ~/.ccache
22+
key: ${{ inputs.cache-primary-key }}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Setup ccache
2+
description: Restore ccache from cache and configure ccache.conf
3+
4+
inputs:
5+
cache-key-prefix:
6+
description: Cache key prefix (e.g. ccache-sitl)
7+
required: true
8+
max-size:
9+
description: Max ccache size (e.g. 300M)
10+
required: false
11+
default: '300M'
12+
base-dir:
13+
description: ccache base_dir value
14+
required: false
15+
default: '${GITHUB_WORKSPACE}'
16+
install-ccache:
17+
description: Install ccache via apt before configuring
18+
required: false
19+
default: 'false'
20+
21+
outputs:
22+
cache-primary-key:
23+
description: Primary cache key (pass to save-ccache)
24+
value: ${{ steps.restore.outputs.cache-primary-key }}
25+
26+
runs:
27+
using: composite
28+
steps:
29+
- name: Cache - Install ccache
30+
if: inputs.install-ccache == 'true'
31+
shell: bash
32+
run: apt-get update && apt-get install -y ccache
33+
34+
- name: Cache - Restore ccache
35+
id: restore
36+
uses: actions/cache/restore@v5
37+
with:
38+
path: ~/.ccache
39+
key: ${{ inputs.cache-key-prefix }}-${{ github.ref_name }}-${{ github.sha }}
40+
restore-keys: |
41+
${{ inputs.cache-key-prefix }}-${{ github.ref_name }}-
42+
${{ inputs.cache-key-prefix }}-${{ github.base_ref || 'main' }}-
43+
${{ inputs.cache-key-prefix }}-
44+
45+
- name: Cache - Configure ccache
46+
shell: bash
47+
run: |
48+
mkdir -p ~/.ccache
49+
echo "base_dir = ${{ inputs.base-dir }}" > ~/.ccache/ccache.conf
50+
echo "compression = true" >> ~/.ccache/ccache.conf
51+
echo "compression_level = 6" >> ~/.ccache/ccache.conf
52+
echo "max_size = ${{ inputs.max-size }}" >> ~/.ccache/ccache.conf
53+
echo "hash_dir = false" >> ~/.ccache/ccache.conf
54+
echo "compiler_check = content" >> ~/.ccache/ccache.conf
55+
ccache -s
56+
ccache -z

.github/workflows/build_all_targets.yml

Lines changed: 76 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -69,32 +69,31 @@ jobs:
6969
runs-on: [runs-on,runner=1cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false]
7070
outputs:
7171
matrix: ${{ steps.set-matrix.outputs.matrix }}
72+
seeders: ${{ steps.set-seeders.outputs.seeders }}
7273
timestamp: ${{ steps.set-timestamp.outputs.timestamp }}
7374
branchname: ${{ steps.set-branch.outputs.branchname }}
7475
steps:
75-
- uses: actions/checkout@v4
76+
- uses: actions/checkout@v6
7677

7778
- name: Cache Python pip
78-
uses: actions/cache@v4
79+
uses: actions/cache@v5
7980
with:
8081
path: ~/.cache/pip
8182
key: ${{ runner.os }}-pip-${{ hashFiles('**./Tools/setup/requirements.txt') }}
8283
restore-keys: |
8384
${{ runner.os }}-pip-
8485
85-
- name: Update python packaging to avoid canonicalize_version() error
86-
run: |
87-
pip3 install -U packaging
88-
8986
- name: Install Python Dependencies
90-
uses: py-actions/py-dependency-install@v4
91-
with:
92-
path: "./Tools/setup/requirements.txt"
87+
run: pip3 install -U packaging -r ./Tools/setup/requirements.txt
9388

9489
- id: set-matrix
9590
name: Generate Build Matrix
9691
run: echo "matrix=$(./Tools/ci/generate_board_targets_json.py --group)" >> $GITHUB_OUTPUT
9792

93+
- id: set-seeders
94+
name: Generate Seeder Matrix
95+
run: echo "seeders=$(./Tools/ci/generate_board_targets_json.py --group --seeders)" >> $GITHUB_OUTPUT
96+
9897
- id: set-timestamp
9998
name: Save Current Timestamp
10099
run: echo "timestamp=$(date +"%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT
@@ -116,11 +115,52 @@ jobs:
116115
echo "${{ steps.set-branch.outputs.branchname }}"
117116
echo "$(./Tools/ci/generate_board_targets_json.py --group --verbose)"
118117
118+
# ===========================================================================
119+
# CACHE SEEDER JOBS
120+
# ===========================================================================
121+
# Build one representative target per chip family to warm the ccache.
122+
# Matrix jobs fall back to these caches via restore-keys when no
123+
# group-specific cache exists yet. If any seeder fails, the build matrix
124+
# does not start, catching common build errors early.
125+
# ===========================================================================
126+
127+
seed:
128+
name: Seed [${{ matrix.chip_family }}]
129+
needs: group_targets
130+
runs-on: [runs-on,"runner=8cpu-linux-${{ matrix.runner }}","image=ubuntu24-full-${{ matrix.runner }}","run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
131+
strategy:
132+
matrix: ${{ fromJson(needs.group_targets.outputs.seeders) }}
133+
fail-fast: false
134+
container:
135+
image: ${{ matrix.container }}
136+
credentials:
137+
username: ${{ github.actor }}
138+
password: ${{ secrets.GITHUB_TOKEN }}
139+
steps:
140+
- uses: runs-on/action@v2
141+
- uses: actions/checkout@v6
142+
with:
143+
fetch-depth: 1
144+
- name: Configure Git Safe Directory
145+
run: git config --system --add safe.directory '*'
146+
- uses: ./.github/actions/setup-ccache
147+
id: ccache
148+
with:
149+
cache-key-prefix: ccache-${{ matrix.chip_family }}-${{ matrix.runner }}-seeder
150+
max-size: 400M
151+
- name: Build seed target
152+
run: make ${{ matrix.target }}
153+
- uses: ./.github/actions/save-ccache
154+
if: always()
155+
with:
156+
cache-primary-key: ${{ steps.ccache.outputs.cache-primary-key }}
157+
119158
setup:
120159
name: Build [${{ matrix.runner }}][${{ matrix.group }}]
121160
# runs-on: ubuntu-latest
122-
runs-on: [runs-on,"runner=8cpu-linux-${{ matrix.runner }}","image=ubuntu24-full-${{ matrix.runner }}","run-id=${{ github.run_id }}",spot=false]
123-
needs: group_targets
161+
runs-on: [runs-on,"runner=4cpu-linux-${{ matrix.runner }}","image=ubuntu24-full-${{ matrix.runner }}","run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
162+
needs: [group_targets, seed]
163+
if: "!failure() && !cancelled()"
124164
strategy:
125165
matrix: ${{ fromJson(needs.group_targets.outputs.matrix) }}
126166
fail-fast: false
@@ -131,41 +171,35 @@ jobs:
131171
password: ${{ secrets.GITHUB_TOKEN }}
132172
steps:
133173
- uses: runs-on/action@v2
134-
- uses: actions/checkout@v4
174+
- uses: actions/checkout@v6
135175
with:
136176
fetch-depth: 0
137-
138-
- name: Git ownership workaround
177+
- name: Configure Git Safe Directory
139178
run: git config --system --add safe.directory '*'
140179

141-
# ccache key breakdown:
142-
# ccache-<system os>-<system arch>-<builder group>-
143-
# ccache-<linux>-<arm64>-<aarch64-0>-
144-
# ccache-<linux>-<x64>-<nuttx-0>-
145-
- name: Cache Restore from Key
146-
id: cc_restore
147-
uses: actions/cache/restore@v4
180+
- name: Cache - Restore ccache
181+
id: ccache-restore
182+
uses: actions/cache/restore@v5
148183
with:
149184
path: ~/.ccache
150-
key: ${{ format('ccache-{0}-{1}-{2}', runner.os, matrix.runner, matrix.group) }}
185+
key: ccache-${{ matrix.chip_family }}-${{ matrix.runner }}-${{ matrix.group }}-${{ github.ref_name }}-${{ github.sha }}
151186
restore-keys: |
152-
ccache-${{ runner.os }}-${{ matrix.runner }}-${{ matrix.group }}-
153-
ccache-${{ runner.os }}-${{ matrix.runner }}-
154-
ccache-${{ runner.os }}-${{ matrix.runner }}-
155-
ccache-${{ runner.os }}-
156-
ccache-
187+
ccache-${{ matrix.chip_family }}-${{ matrix.runner }}-${{ matrix.group }}-${{ github.ref_name }}-
188+
ccache-${{ matrix.chip_family }}-${{ matrix.runner }}-${{ matrix.group }}-${{ github.base_ref || 'main' }}-
189+
ccache-${{ matrix.chip_family }}-${{ matrix.runner }}-${{ matrix.group }}-
190+
ccache-${{ matrix.chip_family }}-${{ matrix.runner }}-
157191
158-
- name: Cache Config and Stats
192+
- name: Cache - Configure ccache
159193
run: |
160-
mkdir -p ~/.ccache
161-
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
162-
echo "compression = true" >> ~/.ccache/ccache.conf
163-
echo "compression_level = 6" >> ~/.ccache/ccache.conf
164-
echo "max_size = 120M" >> ~/.ccache/ccache.conf
165-
echo "hash_dir = false" >> ~/.ccache/ccache.conf
166-
echo "compiler_check = content" >> ~/.ccache/ccache.conf
167-
ccache -s
168-
ccache -z
194+
mkdir -p ~/.ccache
195+
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
196+
echo "compression = true" >> ~/.ccache/ccache.conf
197+
echo "compression_level = 6" >> ~/.ccache/ccache.conf
198+
echo "max_size = ${{ matrix.cache_size }}" >> ~/.ccache/ccache.conf
199+
echo "hash_dir = false" >> ~/.ccache/ccache.conf
200+
echo "compiler_check = content" >> ~/.ccache/ccache.conf
201+
ccache -s
202+
ccache -z
169203
170204
- name: Building Artifacts for [${{ matrix.targets }}]
171205
run: |
@@ -176,23 +210,15 @@ jobs:
176210
./Tools/ci/package_build_artifacts.sh
177211
178212
- name: Upload Build Artifacts
179-
uses: actions/upload-artifact@v4
213+
uses: actions/upload-artifact@v7
180214
with:
181215
name: px4_${{matrix.group}}_build_artifacts
182216
path: artifacts/
183217

184-
- name: Cache Post Build Stats
185-
if: always()
186-
run: |
187-
ccache -s
188-
ccache -z
189-
190-
- name: Cache Save
191-
if: always()
192-
uses: actions/cache/save@v4
218+
- uses: ./.github/actions/save-ccache
219+
if: success()
193220
with:
194-
path: ~/.ccache
195-
key: ${{ steps.cc_restore.outputs.cache-primary-key }}
221+
cache-primary-key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
196222

197223
# ===========================================================================
198224
# ARTIFACT UPLOAD JOB
@@ -211,7 +237,7 @@ jobs:
211237
uploadlocation: ${{ steps.upload-location.outputs.uploadlocation }}
212238
steps:
213239
- name: Download Artifacts
214-
uses: actions/download-artifact@v4
240+
uses: actions/download-artifact@v8
215241
with:
216242
path: artifacts/
217243
merge-multiple: true

0 commit comments

Comments
 (0)