Skip to content
41 changes: 30 additions & 11 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,52 @@ on:
paths-ignore:
- 'docs/**'

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

gate_checks:
name: Gate Checks [${{ matrix.check }}]
runs-on: [runs-on,runner=2cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
container:
image: ghcr.io/px4/px4-dev:v1.17.0-rc2

strategy:
fail-fast: true
matrix:
check: [
"check_format",
"check_newlines",
"tests",
"validate_module_configs",
"shellcheck_all",
"module_documentation",
]
steps:
- uses: runs-on/action@v2

- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Configure Git Safe Directory
run: git config --system --add safe.directory '*'

- name: Building [${{ matrix.check }}]
env:
PX4_SBOM_DISABLE: 1
run: make ${{ matrix.check }}

tests:
name: Unit Tests
runs-on: [runs-on,runner=8cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
container:
image: ghcr.io/px4/px4-dev:v1.17.0-rc2
steps:
- uses: runs-on/action@v2

- uses: actions/checkout@v4
with:
fetch-depth: 1
Expand All @@ -45,19 +67,16 @@ jobs:

- uses: ./.github/actions/setup-ccache
id: ccache
if: matrix.check == 'tests'
with:
cache-key-prefix: ccache-sitl
max-size: 300M

- name: Building [${{ matrix.check }}]
- name: Build and run unit tests
env:
PX4_SBOM_DISABLE: 1
run: |
cd "$GITHUB_WORKSPACE"
make ${{ matrix.check }}
run: make tests

- uses: ./.github/actions/save-ccache
if: always() && matrix.check == 'tests'
if: always()
with:
cache-primary-key: ${{ steps.ccache.outputs.cache-primary-key }}
2 changes: 1 addition & 1 deletion .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
id: ccache
with:
cache-key-prefix: ccache-clang-tidy
max-size: 120M
max-size: 150M

- name: Build - px4_sitl_default (Clang)
run: make -j16 px4_sitl_default-clang
Expand Down
68 changes: 34 additions & 34 deletions .github/workflows/compile_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ concurrency:
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
config: [
px4_fmu-v5_default,
px4_sitl
]
steps:
- name: install Python 3.10
uses: actions/setup-python@v5
Expand All @@ -33,35 +27,41 @@ jobs:

- uses: actions/checkout@v4

- name: setup
run: |
./Tools/setup/macos.sh
- name: Cache - Restore Homebrew Packages
uses: actions/cache@v4
with:
path: ~/Library/Caches/Homebrew/downloads
key: macos-homebrew-${{ runner.arch }}-${{ hashFiles('Tools/setup/macos.sh') }}
restore-keys: |
macos-homebrew-${{ runner.arch }}-

- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
file(APPEND "$ENV{GITHUB_OUTPUT}" "timestamp=${current_date}\n")
- name: ccache cache files
- name: Cache - Restore pip Packages
uses: actions/cache@v4
with:
path: ~/.ccache
key: macos_${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: macos_${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 6" >> ~/.ccache/ccache.conf
echo "max_size = 40M" >> ~/.ccache/ccache.conf
echo "hash_dir = false" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
path: ~/Library/Caches/pip
key: macos-pip-${{ runner.arch }}-${{ hashFiles('Tools/setup/requirements.txt') }}
restore-keys: |
macos-pip-${{ runner.arch }}-

- name: make ${{matrix.config}}
run: |
ccache -z
make ${{matrix.config}}
ccache -s
- name: setup
run: ./Tools/setup/macos.sh

- uses: ./.github/actions/setup-ccache
id: ccache
with:
cache-key-prefix: ccache-macos
max-size: 200M

- name: Build px4_sitl
run: make px4_sitl

- name: Cache - Stats after px4_sitl
run: ccache -s

- name: Build px4_fmu-v5_default
run: make px4_fmu-v5_default

- uses: ./.github/actions/save-ccache
if: always()
with:
cache-primary-key: ${{ steps.ccache.outputs.cache-primary-key }}
25 changes: 18 additions & 7 deletions .github/workflows/compile_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ jobs:
fail-fast: false
matrix:
version: ['ubuntu:22.04', 'ubuntu:24.04']
runs-on: [runs-on,runner=4cpu-linux-x64,"image=ubuntu24-full-x64","run-id=${{ github.run_id }}",spot=false]
runs-on: [runs-on,runner=4cpu-linux-x64,"image=ubuntu24-full-x64","run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
container:
image: ${{ matrix.version }}
volumes:
- /github/workspace:/github/workspace
steps:
- uses: runs-on/action@v2

- name: Fix git in container
run: |
Expand All @@ -53,9 +54,19 @@ jobs:
if: startsWith(runner.name, 'runs-on--')
run: ./Tools/ci/use_aws_apt_mirror.sh

- name: Install Deps, Build, and Make Quick Check
run: |
# we need to install dependencies and build on the same step
# given the stateless nature of docker images
./Tools/setup/ubuntu.sh
make quick_check
- name: Install Deps
run: ./Tools/setup/ubuntu.sh

- uses: ./.github/actions/setup-ccache
id: ccache
with:
cache-key-prefix: ccache-ubuntu-${{ matrix.version }}
max-size: 200M

- name: Make Quick Check
run: make quick_check

- uses: ./.github/actions/save-ccache
if: always()
with:
cache-primary-key: ${{ steps.ccache.outputs.cache-primary-key }}
6 changes: 3 additions & 3 deletions .github/workflows/docs-orchestrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
container:
image: ghcr.io/px4/px4-dev:v1.17.0-rc2
steps:
- uses: runs-on/action@v1
- uses: runs-on/action@v2

- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
container:
image: ghcr.io/px4/px4-dev:v1.17.0-rc2
steps:
- uses: runs-on/action@v1
- uses: runs-on/action@v2

- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -332,7 +332,7 @@ jobs:
branchname: ${{ steps.set-branch.outputs.branchname }}
releaseversion: ${{ steps.set-version.outputs.releaseversion }}
steps:
- uses: runs-on/action@v1
- uses: runs-on/action@v2

- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
build:
runs-on: [runs-on,runner=4cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",extras=s3-cache,spot=false]
steps:
- uses: runs-on/action@v1
- uses: runs-on/action@v2
- name: Checkout
uses: actions/checkout@v4

Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/failsafe_sim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,51 @@

jobs:
build:
runs-on: ubuntu-latest
runs-on: [runs-on,runner=4cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
check: [
"failsafe_web",
]
container:
image: ghcr.io/px4/px4-dev:v1.17.0-rc2
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: runs-on/action@v2

- name: Install Node v20.18.0
uses: actions/setup-node@v4
with:
node-version: 20.18.0

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Git ownership workaround
run: git config --system --add safe.directory '*'

- name: Cache - Restore Emscripten SDK
id: cache-emsdk
uses: actions/cache@v4
with:
path: _emscripten_sdk
key: emsdk-4.0.15

- name: Install empscripten
if: steps.cache-emsdk.outputs.cache-hit != 'true'
run: |
git clone https://github.com/emscripten-core/emsdk.git _emscripten_sdk
cd _emscripten_sdk
git checkout 4.0.15
./emsdk install latest
./emsdk activate latest

- name: Testing [${{ matrix.check }}]
run: |
. ./_emscripten_sdk/emsdk_env.sh
make ${{ matrix.check }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Loading
Loading