Skip to content

Commit

Permalink
Merge branch 'main' into dev/bidirectional_dshot_single_timer
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKlimaj authored Dec 18, 2024
2 parents 03528b3 + 8a93913 commit 1009c6e
Show file tree
Hide file tree
Showing 216 changed files with 4,111 additions and 1,900 deletions.
41 changes: 20 additions & 21 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,27 @@ jobs:
"NO_NINJA_BUILD=1 px4_fmu-v5_default",
"NO_NINJA_BUILD=1 px4_sitl_default",
"px4_sitl_allyes",
"airframe_metadata",
"module_documentation",
"parameters_metadata",
]
container:
image: px4io/px4-dev-nuttx-focal:2022-08-12
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: check environment
run: |
export
ulimit -a
- name: ${{matrix.check}}
run: make ${{matrix.check}}
- name: upload coverage
if: contains(matrix.check, 'coverage')
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
file: coverage/lcov.info
- name: Building [${{ matrix.check }}]
uses: addnab/docker-run-action@v3
with:
image: px4io/px4-dev-nuttx-focal:2022-08-12
options: -v ${{ github.workspace }}:/workspace
run: |
cd /workspace
git config --global --add safe.directory /workspace
make ${{ matrix.check }}
- name: Uploading Coverage to Codecov.io
if: contains(matrix.check, 'coverage')
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
file: coverage/lcov.info
16 changes: 10 additions & 6 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-clang:2021-09-08
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
token: ${{secrets.ACCESS_TOKEN}}
fetch-depth: 0

- uses: corrupt952/[email protected]
- name: Testing (clang-tidy-quiet)
uses: addnab/docker-run-action@v3
with:
command: make clang-tidy-quiet
max_attempts: 3
image: px4io/px4-dev-clang:2021-09-08
options: -v ${{ github.workspace }}:/workspace
run: |
cd /workspace
git config --global --add safe.directory /workspace
make clang-tidy-quiet
8 changes: 3 additions & 5 deletions .github/workflows/compile_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ jobs:
]
steps:
- name: install Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"

- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- uses: actions/checkout@v4

- name: setup
run: ./Tools/setup/macos.sh; ./Tools/setup/macos.sh
Expand All @@ -37,7 +35,7 @@ jobs:
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.ccache
key: macos_${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/dev_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ jobs:
submodules: false
fetch-depth: 0

- name: Set PX4 Tag
id: px4-tag
run: |
echo "tag=$(git describe --tags --match 'v[0-9]*')" >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -44,16 +50,14 @@ jobs:
with:
images: |
ghcr.io/PX4/px4-dev
px4io/px4-dev
${{ (github.event_name != 'pull_request') && 'px4io/px4-dev' || '' }}
tags: |
type=schedule
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch,suffix=-{{date 'YYYYMMDD'}},priority=600
type=ref,event=branch,value=${{ steps.px4-tag.outputs.tag }},priority=700
type=ref,event=branch,suffix=-{{date 'YYYY-MM-DD'}},priority=600
type=ref,event=branch,suffix=,priority=500
type=ref,event=pr
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/ekf_functional_change_indicator.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
name: EKF Change Indicator

on: pull_request
on:
pull_request:
branches:
- '*'

jobs:
unit_tests:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-09-08
steps:
- uses: actions/checkout@v2.3.1
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: checkout newest version of branch
run: |
git fetch origin pull/${{github.event.pull_request.number}}/head:${{github.head_ref}}
git checkout ${GITHUB_HEAD_REF}

- name: main test
run: make tests TESTFILTER=EKF
uses: addnab/docker-run-action@v3
with:
image: px4io/px4-dev-base-focal:2021-09-08
options: -v ${{ github.workspace }}:/workspace
run: |
cd /workspace
git config --global --add safe.directory /workspace
make tests TESTFILTER=EKF
- name: Check if there is a functional change
run: git diff --exit-code
working-directory: src/modules/ekf2/test/change_indication
31 changes: 23 additions & 8 deletions .github/workflows/ekf_update_change_indicator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,40 @@ on: push
jobs:
unit_tests:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-09-08
env:
GIT_COMMITTER_EMAIL: [email protected]
GIT_COMMITTER_NAME: PX4BuildBot
steps:
- uses: actions/checkout@v2.3.1
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: main test updates change indication files
run: make tests TESTFILTER=EKF

- name: main test
uses: addnab/docker-run-action@v3
with:
image: px4io/px4-dev-base-focal:2021-09-08
options: -v ${{ github.workspace }}:/workspace
run: |
cd /workspace
git config --global --add safe.directory /workspace
make tests TESTFILTER=EKF
- name: Check if there exists diff and save result in variable
run: echo "CHANGE_INDICATED=$(git diff --exit-code --output=/dev/null || echo $?)" >> $GITHUB_ENV
id: diff-check
run: echo "CHANGE_INDICATED=$(git diff --exit-code --output=/dev/null || echo $?)" >> $GITHUB_OUTPUT
working-directory: src/modules/ekf2/test/change_indication

- name: auto-commit any changes to change indication
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '[AUTO COMMIT] update change indication'
file_pattern: 'src/modules/ekf2/test/change_indication/*.csv'
commit_user_name: ${GIT_COMMITTER_NAME}
commit_user_email: ${GIT_COMMITTER_EMAIL}
- if: ${{env.CHANGE_INDICATED}}
name: if there is a functional change, fail check
commit_message: |
'[AUTO COMMIT] update change indication'
See .github/workflopws/ekf_update_change_indicator.yml for more details
- name: if there is a functional change, fail check
if: ${{ steps.diff-check.outputs.CHANGE_INDICATED }}
run: exit 1
36 changes: 19 additions & 17 deletions .github/workflows/failsafe_sim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,23 @@ jobs:
image: px4io/px4-dev-nuttx-focal:2022-08-12
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Install Node v20.18.0
uses: actions/setup-node@v4
with:
node-version: 20.18.0

- name: check environment
run: |
export
ulimit -a
- name: install emscripten
run: |
git clone https://github.com/emscripten-core/emsdk.git _emscripten_sdk
cd _emscripten_sdk
./emsdk install latest
./emsdk activate latest
- name: ${{matrix.check}}
run: |
. ./_emscripten_sdk/emsdk_env.sh
make ${{matrix.check}}
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install empscripten
run: |
git clone https://github.com/emscripten-core/emsdk.git _emscripten_sdk
cd _emscripten_sdk
./emsdk install latest
./emsdk activate latest
- name: Testing [${{ matrix.check }}]
run: |
. ./_emscripten_sdk/emsdk_env.sh
make ${{ matrix.check }}
55 changes: 39 additions & 16 deletions .github/workflows/flash_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
branches:
- '*'

env:
MIN_FLASH_POS_DIFF_FOR_COMMENT: 50
MIN_FLASH_NEG_DIFF_FOR_COMMENT: -50

jobs:
analyze_flash:
name: Analyzing ${{ matrix.target }}
Expand All @@ -18,8 +22,10 @@ jobs:
matrix:
target: [px4_fmu-v5x, px4_fmu-v6x]
outputs:
px4_fmu-v5x: ${{ steps.gen-output.outputs.output_px4_fmu-v5x }}
px4_fmu-v6x: ${{ steps.gen-output.outputs.output_px4_fmu-v6x }}
px4_fmu-v5x-bloaty-output: ${{ steps.gen-output.outputs.px4_fmu-v5x-bloaty-output }}
px4_fmu-v5x-bloaty-summary-map: ${{ steps.gen-output.outputs.px4_fmu-v5x-bloaty-summary-map }}
px4_fmu-v6x-bloaty-output: ${{ steps.gen-output.outputs.px4_fmu-v6x-bloaty-output }}
px4_fmu-v6x-bloaty-summary-map: ${{ steps.gen-output.outputs.px4_fmu-v6x-bloaty-summary-map }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -30,19 +36,20 @@ jobs:
run: git config --system --add safe.directory '*'

- name: Build Target
run: make ${{ matrix.target }}
run: make ${{ matrix.target }}_flash-analysis

- name: Store the ELF with the change
run: cp ./build/${{ matrix.target }}_default/${{ matrix.target }}_default.elf ./with-change.elf
run: cp ./build/**/*.elf ./with-change.elf

- name: Clean previous build
run: |
make clean
make distclean
- name: If it's a PR checkout the base commit
- name: If it's a PR checkout the base branch
if: ${{ github.event.pull_request }}
run: git checkout ${{ github.event.pull_request.base.sha }}
# As checkout creates a merge commit (merging the base branch into the PR branch), the base branch is the base for a diff of the PR changes.
run: git checkout ${{ github.event.pull_request.base.ref }}

- name: If it's a push checkout the previous commit
if: github.event_name == 'push'
Expand All @@ -52,30 +59,39 @@ jobs:
run: make submodulesupdate

- name: Build
run: make ${{ matrix.target }}
run: make ${{ matrix.target }}_flash-analysis

- name: Store the ELF before the change
run: cp ./build/${{ matrix.target }}_default/${{ matrix.target }}_default.elf ./before-change.elf
run: cp ./build/**/*.elf ./before-change.elf

- name: bloaty-action
uses: carlosperate/bloaty-action@v1.1.0
uses: PX4/bloaty-action@v1.0.0
id: bloaty-step
with:
bloaty-args: -d sections,compileunits -n 0 ./with-change.elf -- ./before-change.elf
bloaty-file-args: ./with-change.elf -- ./before-change.elf
bloaty-additional-args: -d sections,compileunits -s vm -n 20
output-to-summary: true

- name: Generate output
id: gen-output
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "output_${{ matrix.target }}<<$EOF" >> $GITHUB_OUTPUT
echo "${{ matrix.target }}-bloaty-output<<$EOF" >> $GITHUB_OUTPUT
echo "${{ steps.bloaty-step.outputs.bloaty-output-encoded }}" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
echo "${{ matrix.target }}-bloaty-summary-map<<$EOF" >> $GITHUB_OUTPUT
echo '${{ steps.bloaty-step.outputs.bloaty-summary-map }}' >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
post_pr_comment:
name: Publish Results
runs-on: [runs-on,runner=1cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false]
needs: [analyze_flash]
env:
V5X-SUMMARY-MAP-ABS: ${{ fromJSON(fromJSON(needs.analyze_flash.outputs.px4_fmu-v5x-bloaty-summary-map).vm-absolute) }}
V5X-SUMMARY-MAP-PERC: ${{ fromJSON(fromJSON(needs.analyze_flash.outputs.px4_fmu-v5x-bloaty-summary-map).vm-percentage) }}
V6X-SUMMARY-MAP-ABS: ${{ fromJSON(fromJSON(needs.analyze_flash.outputs.px4_fmu-v6x-bloaty-summary-map).vm-absolute) }}
V6X-SUMMARY-MAP-PERC: ${{ fromJSON(fromJSON(needs.analyze_flash.outputs.px4_fmu-v6x-bloaty-summary-map).vm-percentage) }}
if: ${{ github.event.pull_request }}
steps:
- name: Find Comment
Expand All @@ -92,25 +108,32 @@ jobs:
echo "timestamp=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT
- name: Create or update comment
# This can't be moved to the job-level conditions, as GH actions don't allow a job-level if condition to access the env.
if: |
steps.fc.outputs.comment-id != '' ||
env.V5X-SUMMARY-MAP-ABS >= fromJSON(env.MIN_FLASH_POS_DIFF_FOR_COMMENT) ||
env.V5X-SUMMARY-MAP-ABS <= fromJSON(env.MIN_FLASH_NEG_DIFF_FOR_COMMENT) ||
env.V6X-SUMMARY-MAP-ABS >= fromJSON(env.MIN_FLASH_POS_DIFF_FOR_COMMENT) ||
env.V6X-SUMMARY-MAP-ABS <= fromJSON(env.MIN_FLASH_NEG_DIFF_FOR_COMMENT)
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## FLASH Analysis
## 🔎 FLASH Analysis
<details>
<summary>px4_fmu-v5x</summary>
<summary>px4_fmu-v5x [Total VM Diff: ${{ env.V5X-SUMMARY-MAP-ABS }} byte (${{ env.V5X-SUMMARY-MAP-PERC}} %)]</summary>
```
${{ needs.analyze_flash.outputs.px4_fmu-v5x }}
${{ needs.analyze_flash.outputs.px4_fmu-v5x-bloaty-output }}
```
</details>
<details>
<summary>px4_fmu-v6x</summary>
<summary>px4_fmu-v6x [Total VM Diff: ${{ env.V6X-SUMMARY-MAP-ABS }} byte (${{ env.V6X-SUMMARY-MAP-PERC }} %)]</summary>
```
${{ needs.analyze_flash.outputs.px4_fmu-v6x }}
${{ needs.analyze_flash.outputs.px4_fmu-v6x-bloaty-output }}
```
</details>
Expand Down
Loading

0 comments on commit 1009c6e

Please sign in to comment.