Skip to content

Commit

Permalink
Merge branch 'feature/gz_strivermini' of github.com:tiiuae/px4-firmwa…
Browse files Browse the repository at this point in the history
…re into feature/gz_strivermini
  • Loading branch information
stibipet committed Jul 22, 2024
2 parents f292ad1 + 4f887d8 commit b29bffc
Show file tree
Hide file tree
Showing 214 changed files with 343,829 additions and 928 deletions.
56 changes: 0 additions & 56 deletions .github/workflows/tiiuae-blackduck-scan.yaml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/tiiuae-codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "CodeQL"

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read

strategy:
fail-fast: false
matrix:
language: [c-cpp]
product: [ssrc_saluki-v2_default, ssrc_saluki-nxp93_flat]

container:
image: ghcr.io/tiiuae/px4-firmware-builder-base:latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_REPO_TOKEN }}
submodules: recursive
fetch-depth: 0
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Build
run: |
git config --global --add safe.directory '*'
./packaging/build_px4fw.sh ${{ matrix.product }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
47 changes: 0 additions & 47 deletions .github/workflows/tiiuae-coverity-scan-image.yaml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/tiiuae-coverity-scan.yaml

This file was deleted.

69 changes: 58 additions & 11 deletions .github/workflows/tiiuae-pixhawk-and-saluki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
workflow_dispatch:
inputs:
jfrog-upload:
description: 'upload to Artifactory'
description: 'upload to UAE Artifactory'
required: false
default: false
type: boolean
Expand All @@ -30,22 +30,28 @@ on:
required: false
default: ''
type: string

saluki-fmu2-manual-fpga-version:
description: 'saluki-fmu2 optional fpga version (e.g. sha-cd7bb6b)'
required: false
default: ''
type: string
permissions:
contents: read
packages: write

env:
saluki_pi_fpga_version: "sha-b7e842d"
saluki_v2_fpga_version: "sha-b7e842d"
saluki_v3_fpga_version: "sha-b7e842d"
saluki_fpga_repo: "ghcr.io/tiiuae/saluki-fpga"
saluki_pi_fpga_version: "4.14.0"
saluki_v2_fpga_version: "4.14.0"
saluki_v3_fpga_version: "4.14.0"
saluki_fmu2_fpga_version: "4.14.0"

jobs:
fc_matrix:
strategy:
fail-fast: false
matrix:
product: [pixhawk, fmu-v6xrt, saluki-v2_default, saluki-v2_amp, saluki-v2_flat, saluki-pi_default, saluki-pi_amp, saluki-pi_flat, saluki-v3_default, saluki-v3_amp, saluki-v3_flat]
product: [pixhawk, fmu-v6xrt, saluki-v2_default, saluki-v2_amp, saluki-v2_flat, saluki-pi_default, saluki-pi_amp, saluki-pi_flat, saluki-v3_default, saluki-v3_amp, saluki-v3_flat, saluki-nxp93_flat]
include:
- product: saluki-v2_custom_keys
keys: Tools/saluki-sec-scripts/custom_keys/saluki-v2/px4_bin_ed25519_private.pem
Expand All @@ -69,6 +75,7 @@ jobs:
saluki_v2_fpga_version: ${{ steps.variables.outputs.saluki_v2_fpga_version }}
saluki_v3_fpga_version: ${{ steps.variables.outputs.saluki_v3_fpga_version }}
saluki_pi_fpga_version: ${{ steps.variables.outputs.saluki_pi_fpga_version }}
saluki_fmu2_fpga_version: ${{ steps.variables.outputs.saluki_fmu2_fpga_version }}
steps:
- name: Print input variables
id: variables
Expand All @@ -91,14 +98,22 @@ jobs:
saluki_pi_fpga_version=${{ github.event.inputs.saluki-pi-manual-fpga-version }}
fi
# use saluki-fmu2-fpga default version if custom is not provided
saluki_fmu2_fpga_version=${{ env.saluki_fmu2_fpga_version }}
if [ -n "${{ github.event.inputs.saluki-fmu2-manual-fpga-version }}" ]; then
saluki_fmu2_fpga_version=${{ github.event.inputs.saluki-fmu2-manual-fpga-version }}
fi
echo "saluki_v2_fpga_version=${saluki_v2_fpga_version}" >> $GITHUB_OUTPUT
echo "saluki_v3_fpga_version=${saluki_v3_fpga_version}" >> $GITHUB_OUTPUT
echo "saluki_pi_fpga_version=${saluki_pi_fpga_version}" >> $GITHUB_OUTPUT
echo "saluki_fmu2_fpga_version=${saluki_fmu2_fpga_version}" >> $GITHUB_OUTPUT
echo "jfrog_upload=${{ github.event.inputs.jfrog-upload }}" >> $GITHUB_OUTPUT
echo "saluki_v2_fpga_version: ${saluki_v2_fpga_version}"
echo "saluki_v3_fpga_version: ${saluki_v3_fpga_version}"
echo "saluki_pi_fpga_version: ${saluki_pi_fpga_version}"
echo "saluki_fmu2_fpga_version: ${saluki_fmu2_fpga_version}"
echo "jfrog_upload: ${{ github.event.inputs.jfrog-upload }}"
px4fwupdater:
Expand Down Expand Up @@ -137,6 +152,8 @@ jobs:
upload-px4fwupdater:
name: upload px4fwupdater to docker registry
runs-on: ubuntu-latest
env:
FPGA_DIR: fpga
needs:
- px4fwupdater
- variables
Expand All @@ -146,11 +163,18 @@ jobs:
with:
path: px4-firmware
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download pixhawk artifacts
uses: actions/download-artifact@v4
with:
name: pixhawk
path: bin
pattern: saluki-*
merge-multiple: true
- name: Firmware flasher - Container metadata
id: containermeta # referenced from later step
uses: docker/metadata-action@v5
Expand All @@ -167,18 +191,38 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: fetch fpga files
run: |
echo "fetching fpga files from ${{ env.saluki_fpga_repo }}"
px4-firmware/Tools/fetch-fpga-files.sh ${{ env.saluki_fpga_repo }}:${{ needs.variables.outputs.saluki_v2_fpga_version }} saluki_v2 ${{ env.FPGA_DIR }}/saluki-v2
px4-firmware/Tools/fetch-fpga-files.sh ${{ env.saluki_fpga_repo }}:${{ needs.variables.outputs.saluki_v3_fpga_version }} saluki_v3 ${{ env.FPGA_DIR }}/saluki-v3
px4-firmware/Tools/fetch-fpga-files.sh ${{ env.saluki_fpga_repo }}:${{ needs.variables.outputs.saluki_pi_fpga_version }} saluki_pi ${{ env.FPGA_DIR }}/saluki-pi
px4-firmware/Tools/fetch-fpga-files.sh ${{ env.saluki_fpga_repo }}:${{ needs.variables.outputs.saluki_fmu2_fpga_version }} saluki_fmu2 ${{ env.FPGA_DIR }}/saluki-fmu2
# combine fpga json files to one file
python px4-firmware/Tools/collect_json_files.py ${{ env.FPGA_DIR }} ${{ env.FPGA_DIR }}/fpga-file-info.json
# generate saluki file info json with project basic info
# fetched info from git so has to be ran inside the repo
pushd px4-firmware
Tools/generate_basic_build_info.sh ../build_basic_info.json
popd
# combine saluki file info json with fpga json and px4 json files to one file
python px4-firmware/Tools/compile_px4_build_info.py saluki_file_info.json bin ${{ env.FPGA_DIR }}/fpga-file-info.json build_basic_info.json
- name: Firmware flasher - Build and push
uses: docker/build-push-action@v5
with:
push: true
context: .
# build for x86 and arm64
platforms: linux/amd64,linux/arm64
file: px4-firmware/Tools/px_uploader.Dockerfile
tags: ${{ steps.containermeta.outputs.tags }}
labels: ${{ steps.containermeta.outputs.labels }}
build-args: |
"saluki_pi_fpga_version=${{ needs.variables.outputs.saluki_pi_fpga_version }}"
"saluki_v2_fpga_version=${{ needs.variables.outputs.saluki_v2_fpga_version }}"
"saluki_v3_fpga_version=${{ needs.variables.outputs.saluki_v3_fpga_version }}"
"saluki_fpga_directory=${{ env.FPGA_DIR }}"
- name: Build overview
run: |
echo "### Build overview:" >> $GITHUB_STEP_SUMMARY
Expand All @@ -188,6 +232,7 @@ jobs:
echo " saluki_pi_fpga_version: ${{ needs.variables.outputs.saluki_pi_fpga_version }}"
echo " saluki_v2_fpga_version: ${{ needs.variables.outputs.saluki_v2_fpga_version }}"
echo " saluki_v3_fpga_version: ${{ needs.variables.outputs.saluki_v3_fpga_version }}"
echo " saluki_fmu2_fpga_version: ${{ needs.variables.outputs.saluki_fmu2_fpga_version }}"
# in case more than one tag is generated, use the one which mentions commit sha
if (( $(echo "${{ steps.containermeta.outputs.tags }}" | wc -l) > 1 )); then
Expand All @@ -205,6 +250,7 @@ jobs:
echo "FPGA-V2[(Saluki-v2 FPGA\n${{ needs.variables.outputs.saluki_v2_fpga_version }})]" >> $GITHUB_STEP_SUMMARY
echo "FPGA-V3[(Saluki-v3 FPGA\n${{ needs.variables.outputs.saluki_v3_fpga_version }})]" >> $GITHUB_STEP_SUMMARY
echo "FPGA-PI[(Saluki-pi FPGA\n${{ needs.variables.outputs.saluki_pi_fpga_version }})]" >> $GITHUB_STEP_SUMMARY
echo "FPGA-PI[(Saluki-fmu2 FPGA\n${{ needs.variables.outputs.saluki_fmu2_fpga_version }})]" >> $GITHUB_STEP_SUMMARY
echo "PX4-SHA[${{ github.repository }}\n$GITHUB_REF]" >> $GITHUB_STEP_SUMMARY
# build
Expand All @@ -218,6 +264,7 @@ jobs:
echo "FPGA-V2 --> BUILD" >> $GITHUB_STEP_SUMMARY
echo "FPGA-V3 --> BUILD" >> $GITHUB_STEP_SUMMARY
echo "FPGA-PI --> BUILD" >> $GITHUB_STEP_SUMMARY
echo "FPGA-FMU2 --> BUILD" >> $GITHUB_STEP_SUMMARY
echo "BUILD --> OUTPUT" >> $GITHUB_STEP_SUMMARY
# end mermaid flowchart
echo '```' >> $GITHUB_STEP_SUMMARY
Expand Down Expand Up @@ -283,7 +330,6 @@ jobs:
echo '```' >> $GITHUB_STEP_SUMMARY
echo 'For more info please see: https://github.com/tiiuae/fpga-flashing/#usage' >> $GITHUB_STEP_SUMMARY
upload-px4fwupdater-uae:
name: upload px4fwupdater to UAE docker registry
# temporarily disabled until we get new token from UAR
Expand Down Expand Up @@ -338,6 +384,7 @@ jobs:
"saluki_pi_fpga_version=${{ needs.variables.outputs.saluki_pi_fpga_version }}"
"saluki_v2_fpga_version=${{ needs.variables.outputs.saluki_v2_fpga_version }}"
"saluki_v3_fpga_version=${{ needs.variables.outputs.saluki_v3_fpga_version }}"
"saluki_fmu2_fpga_version=${{ needs.variables.outputs.saluki_fmu2_fpga_version }}"
artifactory-uae:
name: upload builds to UAE artifactory
Expand Down
Loading

0 comments on commit b29bffc

Please sign in to comment.