Skip to content

Commit

Permalink
Merge branch 'main' into board_specific_dds_topics
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisTM authored Oct 11, 2024
2 parents d100827 + fd2b3ae commit bfa3c1f
Show file tree
Hide file tree
Showing 185 changed files with 12,536 additions and 796 deletions.
4 changes: 4 additions & 0 deletions .ci/Jenkinsfile-compile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pipeline {
"av_x-v1_default",
"bitcraze_crazyflie21_default",
"bitcraze_crazyflie_default",
"cuav_7-nano_default",
"cuav_can-gps-v1_canbootloader",
"cuav_can-gps-v1_default",
"cuav_nora_default",
Expand Down Expand Up @@ -130,6 +131,9 @@ pipeline {
"thepeach_k1_default",
"thepeach_r1_default",
"uvify_core_default",
"x-mav_ap-h743v2_default",
"zeroone_x6_bootloader",
"zeroone_x6_default",
],
image: docker_images.nuttx,
archive: true
Expand Down
119 changes: 101 additions & 18 deletions .github/workflows/build_all_targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@
name: Build all targets

on:
workflow_dispatch:
inputs:
tag:
required: true
description: release version
push:
tags:
- 'v*'
branches:
- 'main'
- 'stable'
- 'beta'
- 'release/*'
- 'main'
- 'stable'
- 'beta'
- 'release/**'
pull_request:
branches:
- '*'
- '*'

jobs:
group_targets:
Expand All @@ -24,6 +31,8 @@ jobs:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
timestamp: ${{ steps.set-timestamp.outputs.timestamp }}
tagname: ${{ steps.set-tag.outputs.tagname }}
branchname: ${{ steps.set-branch.outputs.branchname }}
steps:
- uses: actions/checkout@v4

Expand All @@ -33,13 +42,34 @@ jobs:
path: "./Tools/setup/requirements.txt"

- id: set-matrix
run: echo "::set-output name=matrix::$(./Tools/generate_board_targets_json.py --group)"
run: echo "::set-output name=matrix::$(./Tools/ci/generate_board_targets_json.py --group)"

- id: set-timestamp
run: echo "::set-output name=timestamp::$(date +"%Y%m%d%H%M%S")"

# This job is also triggered with versioned tags
# Creating a and pushing a tag starting with "v" just as "v1.0.0"
# will trigger this workflow and when all builds are done create a Github Release
# then it will upload all binaries built as assets
# Additionally, we can also trigger this step manually
# From the Github Actions tab for this repository:
# https://github.com/PX4/PX4-Autopilot/actions/workflows/build_all_targets.yml
# You can now click a "Run Workflow" button that will prompt you for a tag name
# This tag name has to match an existing tag otherwise the new release will be detached
# Note: Only developers with "write" permission to the repository can use this feature
- id: set-tag
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
run: echo "::set-output name=tagname::${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}"

- id: set-branch
run: echo "::set-output name=branchname::${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"

- name: Debug Matrix Output
if: runner.debug == '1'
run: echo "$(./Tools/ci/generate_board_targets_json.py --group --verbose)"

setup:
name: ${{ matrix.group }}
name: Build Group [${{ matrix.group }}]
# runs-on: ubuntu-latest
runs-on: [runs-on,runner=8cpu-linux-x64,image=ubuntu22-full-x64,"run-id=${{ github.run_id }}"]
needs: group_targets
Expand All @@ -52,17 +82,17 @@ jobs:
with:
fetch-depth: 0

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

- name: ccache setup keys
- name: Setup ccache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ matrix.group }}-ccache-${{ needs.group_targets.outputs.timestamp }}
restore-keys: ${{ matrix.group }}-ccache-${{ needs.group_targets.outputs.timestamp }}

- name: setup ccache
- name: Configure ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
Expand All @@ -73,18 +103,71 @@ jobs:
ccache -s
ccache -z
- name: build target group
- name: Building [${{ matrix.group }}]
run: |
./Tools/ci_build_all_runner.sh ${{matrix.targets}}
./Tools/ci/build_all_runner.sh ${{matrix.targets}}
- name: Upload px4 package
- name: Arrange Build Artifacts
run: |
./Tools/ci/package_build_artifacts.sh
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: px4_${{matrix.group}}_build_artifacts
path: |
build/**/*.px4
build/**/*.bin
compression-level: 0
path: artifacts/

- name: ccache post-run
- name: Cache Save
run: ccache -s

artifacts:
name: Upload Artifacts to S3
# runs-on: ubuntu-latest
runs-on: [runs-on,runner=1cpu-linux-x64,image=ubuntu22-full-x64,"run-id=${{ github.run_id }}"]
needs: [setup, group_targets]
if: contains(fromJSON('["main", "stable", "beta"]'), needs.group_targets.outputs.branchname)
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
merge-multiple: true

- name: Branch Name
run: |
echo "${{ needs.group_targets.outputs.branchname }}"
- name: Uploading Artifacts to S3 [${{ needs.group_targets.outputs.branchname == 'main' && 'master' || needs.group_targets.outputs.branchname }}]
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: 'px4-travis'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-1'
SOURCE_DIR: artifacts/
DEST_DIR: Firmware/${{ needs.group_targets.outputs.branchname == 'main' && 'master' || needs.group_targets.outputs.branchname }}/

release:
name: Create Release and Upload Artifacts
# runs-on: ubuntu-latest
runs-on: [runs-on,runner=1cpu-linux-x64,image=ubuntu22-full-x64,"run-id=${{ github.run_id }}"]
needs: [setup, group_targets]
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4

- name: Arrange Binaries
run: |
mkdir artifacts
cp **/**/*.px4 artifacts/
- name: Upload Binaries to Release
uses: softprops/action-gh-release@v2
with:
name: ${{ needs.group_targets.outputs.tagname }}
tag_name: ${{ needs.group_targets.outputs.tagname }}
draft: true
files: artifacts/*.px4
56 changes: 0 additions & 56 deletions .github/workflows/deploy_all.yml

This file was deleted.

133 changes: 0 additions & 133 deletions .github/workflows/metadata.yml

This file was deleted.

Loading

0 comments on commit bfa3c1f

Please sign in to comment.