From 38006205178c9e0772ed391f5e5445e31ae25886 Mon Sep 17 00:00:00 2001 From: Timo Sairiala Date: Mon, 4 Mar 2024 07:54:35 +0200 Subject: [PATCH] run codeql --- .github/workflows/checks.yml | 50 -- .github/workflows/clang-tidy.yml | 21 - .github/workflows/compile_linux.yml | 54 --- .github/workflows/compile_linux_arm64.yml | 51 -- .github/workflows/compile_macos.yml | 56 --- .github/workflows/compile_nuttx.yml | 129 ----- .github/workflows/deploy_all.yml | 54 --- .../ekf_functional_change_indicator.yml | 21 - .../workflows/ekf_update_change_indicator.yml | 29 -- .github/workflows/failsafe_sim.yml | 44 -- .github/workflows/mavros_mission_tests.yml | 139 ------ .github/workflows/mavros_offboard_tests.yml | 134 ----- .github/workflows/metadata.yml | 131 ----- .github/workflows/python_checks.yml | 25 - .github/workflows/sitl_tests.yml | 135 ------ .github/workflows/tiiuae-blackduck-scan.yaml | 56 --- .github/workflows/tiiuae-builder-images.yaml | 42 -- .github/workflows/tiiuae-check-format.yml | 18 - .github/workflows/tiiuae-codeql.yaml | 42 ++ .../workflows/tiiuae-coverity-scan-image.yaml | 47 -- .github/workflows/tiiuae-coverity-scan.yaml | 36 -- .../tiiuae-pixhawk-and-saluki-builder.yaml | 46 -- .../workflows/tiiuae-pixhawk-and-saluki.yaml | 456 ------------------ .github/workflows/tiiuae-sitl-gzsim.yaml | 63 --- .github/workflows/tiiuae-sitl-tests.yml | 72 --- .github/workflows/tiiuae-sitl.yaml | 72 --- 26 files changed, 42 insertions(+), 1981 deletions(-) delete mode 100644 .github/workflows/checks.yml delete mode 100644 .github/workflows/clang-tidy.yml delete mode 100644 .github/workflows/compile_linux.yml delete mode 100644 .github/workflows/compile_linux_arm64.yml delete mode 100644 .github/workflows/compile_macos.yml delete mode 100644 .github/workflows/compile_nuttx.yml delete mode 100644 .github/workflows/deploy_all.yml delete mode 100644 .github/workflows/ekf_functional_change_indicator.yml delete mode 100644 .github/workflows/ekf_update_change_indicator.yml delete mode 100644 .github/workflows/failsafe_sim.yml delete mode 100644 .github/workflows/mavros_mission_tests.yml delete mode 100644 .github/workflows/mavros_offboard_tests.yml delete mode 100644 .github/workflows/metadata.yml delete mode 100644 .github/workflows/python_checks.yml delete mode 100644 .github/workflows/sitl_tests.yml delete mode 100644 .github/workflows/tiiuae-blackduck-scan.yaml delete mode 100644 .github/workflows/tiiuae-builder-images.yaml delete mode 100644 .github/workflows/tiiuae-check-format.yml create mode 100644 .github/workflows/tiiuae-codeql.yaml delete mode 100644 .github/workflows/tiiuae-coverity-scan-image.yaml delete mode 100644 .github/workflows/tiiuae-coverity-scan.yaml delete mode 100644 .github/workflows/tiiuae-pixhawk-and-saluki-builder.yaml delete mode 100644 .github/workflows/tiiuae-pixhawk-and-saluki.yaml delete mode 100644 .github/workflows/tiiuae-sitl-gzsim.yaml delete mode 100644 .github/workflows/tiiuae-sitl-tests.yml delete mode 100644 .github/workflows/tiiuae-sitl.yaml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml deleted file mode 100644 index 3775602e33b1..000000000000 --- a/.github/workflows/checks.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Checks - -on: - push: - branches: - - 'main' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - check: [ - "check_format", - "tests", - "tests_coverage", - "px4_fmu-v2_default stack_check", - "validate_module_configs", - "shellcheck_all", - "NO_NINJA_BUILD=1 px4_fmu-v5_default", - "NO_NINJA_BUILD=1 px4_sitl_default", - "airframe_metadata", - "module_documentation", - "parameters_metadata", - ] - container: - image: px4io/px4-dev-nuttx-focal:2021-09-08 - options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.ACCESS_TOKEN }} - - - 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@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: unittests - file: coverage/lcov.info diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml deleted file mode 100644 index af6b812bd6e6..000000000000 --- a/.github/workflows/clang-tidy.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Clang Tidy - -on: - push: - branches: - - 'main' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - container: px4io/px4-dev-clang:2021-09-08 - steps: - - uses: actions/checkout@v4 - with: - token: ${{secrets.ACCESS_TOKEN}} - - - name: make clang-tidy-quiet - run: make clang-tidy-quiet diff --git a/.github/workflows/compile_linux.yml b/.github/workflows/compile_linux.yml deleted file mode 100644 index 7c2463b3ffa5..000000000000 --- a/.github/workflows/compile_linux.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Linux Targets - -on: - push: - branches: - - 'main' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - container: px4io/px4-dev-armhf:2021-09-08 - strategy: - matrix: - config: [ - beaglebone_blue_default, - emlid_navio2_default, - px4_raspberrypi_default, - scumaker_pilotpi_default, - ] - steps: - - uses: actions/checkout@v4 - with: - token: ${{secrets.ACCESS_TOKEN}} - - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - shell: cmake -P {0} - run: | - 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@v3 - with: - path: ~/.ccache - key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{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 = 100M" >> ~/.ccache/ccache.conf - echo "hash_dir = false" >> ~/.ccache/ccache.conf - ccache -s - ccache -z - - - name: make ${{matrix.config}} - run: make ${{matrix.config}} - - name: ccache post-run - run: ccache -s diff --git a/.github/workflows/compile_linux_arm64.yml b/.github/workflows/compile_linux_arm64.yml deleted file mode 100644 index c67d8153969e..000000000000 --- a/.github/workflows/compile_linux_arm64.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Linux ARM64 Targets - -on: - push: - branches: - - 'main' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - container: px4io/px4-dev-aarch64:2021-09-08 - strategy: - matrix: - config: [ - scumaker_pilotpi_arm64, - ] - steps: - - uses: actions/checkout@v4 - with: - token: ${{secrets.ACCESS_TOKEN}} - - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - shell: cmake -P {0} - run: | - 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@v3 - with: - path: ~/.ccache - key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{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 = 100M" >> ~/.ccache/ccache.conf - echo "hash_dir = false" >> ~/.ccache/ccache.conf - ccache -s - ccache -z - - - name: make ${{matrix.config}} - run: make ${{matrix.config}} - - name: ccache post-run - run: ccache -s diff --git a/.github/workflows/compile_macos.yml b/.github/workflows/compile_macos.yml deleted file mode 100644 index 71db6ce4a312..000000000000 --- a/.github/workflows/compile_macos.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: MacOS build - -on: - push: - branches: - - 'main' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: macos-10.15 - strategy: - matrix: - config: [ - px4_fmu-v5_default, - px4_sitl - #tests, # includes px4_sitl - ] - steps: - - uses: actions/checkout@v4 - with: - token: ${{secrets.ACCESS_TOKEN}} - - - name: setup - run: ./Tools/setup/macos.sh; ./Tools/setup/macos.sh - - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - shell: cmake -P {0} - run: | - 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@v3 - 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 - - - name: make ${{matrix.config}} - run: | - ccache -z - make ${{matrix.config}} - ccache -s diff --git a/.github/workflows/compile_nuttx.yml b/.github/workflows/compile_nuttx.yml deleted file mode 100644 index d9ff5cce2e9b..000000000000 --- a/.github/workflows/compile_nuttx.yml +++ /dev/null @@ -1,129 +0,0 @@ -name: Nuttx Targets - -on: - push: - branches: - - 'main' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - container: px4io/px4-dev-nuttx-focal:2021-09-08 - strategy: - fail-fast: false - matrix: - config: [ - airmind_mindpx-v2, - ark_can-flow, - ark_can-gps, - ark_can-rtk-gps, - ark_cannode, - ark_fmu-v6x, - atl_mantis-edu, - av_x-v1, - bitcraze_crazyflie, - bitcraze_crazyflie21, - cuav_can-gps-v1, - cuav_nora, - cuav_x7pro, - cubepilot_cubeorange, - cubepilot_cubeorangeplus, - cubepilot_cubeyellow, - diatone_mamba-f405-mk2, - freefly_can-rtk-gps, - holybro_can-gps-v1, - holybro_durandal-v1, - holybro_kakutef7, - holybro_kakuteh7, - holybro_pix32v5, - matek_gnss-m9n-f4, - matek_h743, - matek_h743-mini, - matek_h743-slim, - modalai_fc-v1, - modalai_fc-v2, - mro_ctrl-zero-f7, - mro_ctrl-zero-f7-oem, - mro_ctrl-zero-h7, - mro_ctrl-zero-h7-oem, - mro_pixracerpro, - mro_x21, - mro_x21-777, - nxp_fmuk66-e, - nxp_fmuk66-v3, - nxp_mr-canhubk3, - nxp_ucans32k146, - omnibus_f4sd, - px4_fmu-v2, - px4_fmu-v3, - px4_fmu-v4, - px4_fmu-v4pro, - px4_fmu-v5, - px4_fmu-v5x, - px4_fmu-v6c, - px4_fmu-v6u, - px4_fmu-v6x, - px4_fmu-v6xrt, - raspberrypi_pico, - sky-drones_smartap-airlink, - spracing_h7extreme, - uvify_core - ] - steps: - - uses: actions/checkout@v4 - with: - token: ${{secrets.ACCESS_TOKEN}} - - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - shell: cmake -P {0} - run: | - 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@v3 - with: - path: ~/.ccache - key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{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 = 120M" >> ~/.ccache/ccache.conf - echo "hash_dir = false" >> ~/.ccache/ccache.conf - ccache -s - ccache -z - - - name: make all_variants_${{matrix.config}} - run: make all_variants_${{matrix.config}} - timeout-minutes: 45 - - name: make ${{matrix.config}} bloaty_compileunits - run: make ${{matrix.config}} bloaty_compileunits || true - - name: make ${{matrix.config}} bloaty_inlines - run: make ${{matrix.config}} bloaty_inlines || true - - name: make ${{matrix.config}} bloaty_segments - run: make ${{matrix.config}} bloaty_segments || true - - name: make ${{matrix.config}} bloaty_symbols - run: make ${{matrix.config}} bloaty_symbols || true - - name: make ${{matrix.config}} bloaty_templates - run: make ${{matrix.config}} bloaty_templates || true - - name: make ${{matrix.config}} bloaty_ram - run: make ${{matrix.config}} bloaty_ram || true - - name: make ${{matrix.config}} bloaty_compare_master - run: make ${{matrix.config}} bloaty_compare_master || true - - name: ccache post-run - run: ccache -s - - - name: Upload px4 package - uses: actions/upload-artifact@v3.1.3 - with: - name: px4_package_${{matrix.config}} - path: | - build/**/*.px4 - build/**/*.bin diff --git a/.github/workflows/deploy_all.yml b/.github/workflows/deploy_all.yml deleted file mode 100644 index 611e0b46b9a5..000000000000 --- a/.github/workflows/deploy_all.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Deploy metadata for all targets - -on: - push: - branches: - - 'main' - - 'release/*' - - 'pr-metadata-test' - -jobs: - enumerate_targets: - runs-on: ubuntu-latest - container: px4io/px4-dev-base-focal:2021-09-08 - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - uses: actions/checkout@v4 - with: - token: ${{secrets.ACCESS_TOKEN}} - - id: set-matrix - run: echo "::set-output name=matrix::$(./Tools/generate_board_targets_json.py)" - build: - runs-on: ubuntu-latest - needs: enumerate_targets - strategy: - matrix: ${{fromJson(needs.enumerate_targets.outputs.matrix)}} - container: px4io/px4-dev-${{ matrix.container }}:2021-09-08 - steps: - - uses: actions/checkout@v4 - with: - token: ${{secrets.ACCESS_TOKEN}} - - - name: make ${{matrix.target}} - run: make ${{matrix.target}} - - - name: parameter & events metadata - run: | - make ${{matrix.target}} ver_gen events_json actuators_json - ./src/lib/version/get_git_tag_or_branch_version.sh build/${{ matrix.target }} >> $GITHUB_ENV - cd build/${{ matrix.target }} - mkdir _metadata || true - cp parameters.* events/*.xz actuators.json* _metadata - - - 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: 'build/${{ matrix.target }}/_metadata/' - DEST_DIR: 'Firmware/${{ env.version }}/${{ matrix.target }}/' - diff --git a/.github/workflows/ekf_functional_change_indicator.yml b/.github/workflows/ekf_functional_change_indicator.yml deleted file mode 100644 index b52cb8fe4b7b..000000000000 --- a/.github/workflows/ekf_functional_change_indicator.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: EKF Change Indicator - -on: pull_request - -jobs: - unit_tests: - runs-on: ubuntu-latest - container: px4io/px4-dev-base-focal:2021-09-08 - steps: - - 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 - - name: Check if there is a functional change - run: git diff --exit-code - working-directory: src/modules/ekf2/test/change_indication diff --git a/.github/workflows/ekf_update_change_indicator.yml b/.github/workflows/ekf_update_change_indicator.yml deleted file mode 100644 index ba095d8bfb7f..000000000000 --- a/.github/workflows/ekf_update_change_indicator.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: EKF Update Change Indicator - -on: push - -jobs: - unit_tests: - runs-on: ubuntu-latest - container: px4io/px4-dev-base-focal:2021-09-08 - env: - GIT_COMMITTER_EMAIL: bot@px4.io - GIT_COMMITTER_NAME: PX4BuildBot - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: main test updates change indication files - run: 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 - working-directory: src/modules/ekf2/test/change_indication - - name: auto-commit any changes to change indication - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: '[AUTO COMMIT] update change indication' - 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 - run: exit 1 diff --git a/.github/workflows/failsafe_sim.yml b/.github/workflows/failsafe_sim.yml deleted file mode 100644 index 6d5e73d5a521..000000000000 --- a/.github/workflows/failsafe_sim.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Failsafe Simulator Build - -on: - push: - branches: - - 'main' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - check: [ - "failsafe_web", - ] - container: - image: px4io/px4-dev-nuttx-focal:2021-09-08 - options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined - steps: - - uses: actions/checkout@v1 - with: - token: ${{ secrets.ACCESS_TOKEN }} - - - 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}} diff --git a/.github/workflows/mavros_mission_tests.yml b/.github/workflows/mavros_mission_tests.yml deleted file mode 100644 index a50fa120e288..000000000000 --- a/.github/workflows/mavros_mission_tests.yml +++ /dev/null @@ -1,139 +0,0 @@ -name: MAVROS Mission Tests - -on: - push: - branches: - - 'main' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - config: - - {vehicle: "iris", mission: "MC_mission_box", build_type: "RelWithDebInfo"} - - {vehicle: "rover", mission: "rover_mission_1", build_type: "RelWithDebInfo"} - #- {vehicle: "plane", mission: "FW_mission_1", build_type: "RelWithDebInfo"} - #- {vehicle: "plane_catapult",mission: "FW_mission_1", build_type: "RelWithDebInfo"} - #- {vehicle: "standard_vtol", mission: "VTOL_mission_1", build_type: "Coverage"} - #- {vehicle: "standard_vtol", mission: "VTOL_mission_1", build_type: "AddressSanitizer"} - #- {vehicle: "tailsitter", mission: "VTOL_mission_1", build_type: "RelWithDebInfo"} - #- {vehicle: "tiltrotor", mission: "VTOL_mission_1", build_type: "RelWithDebInfo"} - - container: - image: px4io/px4-dev-ros-melodic:2021-09-08 - options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.ACCESS_TOKEN }} - - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - shell: cmake -P {0} - run: | - 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@v3 - with: - path: ~/.ccache - key: sitl_tests-${{matrix.config.build_type}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: sitl_tests-${{matrix.config.build_type}}-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 = 100M" >> ~/.ccache/ccache.conf - echo "hash_dir = false" >> ~/.ccache/ccache.conf - ccache -s - ccache -z - - - name: check environment - run: | - export - ulimit -a - - name: Build PX4 and sitl_gazebo-classic - env: - PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}} - run: | - ccache -z - make px4_sitl_default - make px4_sitl_default sitl_gazebo-classic - ccache -s - - - name: Core dump settings - run: | - ulimit -c unlimited - echo "`pwd`/%e.core" > /proc/sys/kernel/core_pattern - - - name: Run SITL tests - env: - PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}} - run: | - export - ./test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=${{matrix.config.mission}} vehicle:=${{matrix.config.vehicle}} - timeout-minutes: 45 - - - name: Look at core files - if: failure() - run: gdb build/px4_sitl_default/bin/px4 px4.core -ex "thread apply all bt" -ex "quit" - - name: Upload px4 coredump - if: failure() - uses: actions/upload-artifact@v3.1.3 - with: - name: coredump - path: px4.core - - - name: ecl EKF analysis - if: always() - run: ./Tools/ecl_ekf/process_logdata_ekf.py ~/.ros/log/*/*.ulg || true - - - name: Upload logs to flight review - if: always() - run: ./Tools/upload_log.py -q --description "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID}" --feedback "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID} ${GITHUB_REPOSITORY} ${GITHUB_REF}" --source CI ~/.ros/log/*/*.ulg - - - name: Upload px4 binary - if: failure() - uses: actions/upload-artifact@v3.1.3 - with: - name: binary - path: build/px4_sitl_default/bin/px4 - - - name: Store PX4 log - if: failure() - uses: actions/upload-artifact@v3.1.3 - with: - name: px4_log - path: ~/.ros/log/*/*.ulg - - - name: Store ROS log - if: failure() - uses: actions/upload-artifact@v3.1.3 - with: - name: ros_log - path: ~/.ros/**/rostest-*.log - - # Report test coverage - - name: Upload coverage - if: contains(matrix.config.build_type, 'Coverage') - run: | - git config --global credential.helper "" # disable the keychain credential helper - git config --global --add credential.helper store # enable the local store credential helper - echo "https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com" >> ~/.git-credentials # add credential - git config --global url."https://github.com/".insteadof git@github.com: # credentials add credential - mkdir -p coverage - lcov --directory build/px4_sitl_default --base-directory build/px4_sitl_default --gcov-tool gcov --capture -o coverage/lcov.info - - name: Upload coverage information to Codecov - if: contains(matrix.config.build_type, 'Coverage') - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: mavros_mission - file: coverage/lcov.info diff --git a/.github/workflows/mavros_offboard_tests.yml b/.github/workflows/mavros_offboard_tests.yml deleted file mode 100644 index 72f1f87a62d9..000000000000 --- a/.github/workflows/mavros_offboard_tests.yml +++ /dev/null @@ -1,134 +0,0 @@ -name: MAVROS Offboard Tests - -on: - push: - branches: - - 'main' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - config: - - {test_file: "mavros_posix_tests_offboard_posctl.test", vehicle: "iris", build_type: "RelWithDebInfo"} - #- {test_file: "mavros_posix_tests_offboard_attctl.test", vehicle: "iris", build_type: "RelWithDebInfo"} - #- {test_file: "mavros_posix_tests_offboard_rpyrt_ctl.test", vehicle: "iris", build_type: "RelWithDebInfo"} - - container: - image: px4io/px4-dev-ros-melodic:2021-09-08 - options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.ACCESS_TOKEN }} - - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - shell: cmake -P {0} - run: | - 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@v3 - with: - path: ~/.ccache - key: sitl_tests-${{matrix.config.build_type}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: sitl_tests-${{matrix.config.build_type}}-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 = 100M" >> ~/.ccache/ccache.conf - echo "hash_dir = false" >> ~/.ccache/ccache.conf - ccache -s - ccache -z - - - name: check environment - run: | - export - ulimit -a - - name: Build PX4 and sitl_gazebo-classic - env: - PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}} - run: | - ccache -z - make px4_sitl_default - make px4_sitl_default sitl_gazebo-classic - ccache -s - - - name: Core dump settings - run: | - ulimit -c unlimited - echo "`pwd`/%e.core" > /proc/sys/kernel/core_pattern - - - name: Run SITL tests - env: - PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}} - run: | - export - ./test/rostest_px4_run.sh ${{matrix.config.test_file}} vehicle:=${{matrix.config.vehicle}} - timeout-minutes: 45 - - - name: Look at core files - if: failure() - run: gdb build/px4_sitl_default/bin/px4 px4.core -ex "thread apply all bt" -ex "quit" - - name: Upload px4 coredump - if: failure() - uses: actions/upload-artifact@v3.1.3 - with: - name: coredump - path: px4.core - - - name: ecl EKF analysis - if: always() - run: ./Tools/ecl_ekf/process_logdata_ekf.py ~/.ros/log/*/*.ulg || true - - - name: Upload logs to flight review - if: always() - run: ./Tools/upload_log.py -q --description "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID}" --feedback "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID} ${GITHUB_REPOSITORY} ${GITHUB_REF}" --source CI ~/.ros/log/*/*.ulg - - - name: Upload px4 binary - if: failure() - uses: actions/upload-artifact@v3.1.3 - with: - name: binary - path: build/px4_sitl_default/bin/px4 - - - name: Store PX4 log - if: failure() - uses: actions/upload-artifact@v3.1.3 - with: - name: px4_log - path: ~/.ros/log/*/*.ulg - - - name: Store ROS log - if: failure() - uses: actions/upload-artifact@v3.1.3 - with: - name: ros_log - path: ~/.ros/**/rostest-*.log - - # Report test coverage - - name: Upload coverage - if: contains(matrix.config.build_type, 'Coverage') - run: | - git config --global credential.helper "" # disable the keychain credential helper - git config --global --add credential.helper store # enable the local store credential helper - echo "https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com" >> ~/.git-credentials # add credential - git config --global url."https://github.com/".insteadof git@github.com: # credentials add credential - mkdir -p coverage - lcov --directory build/px4_sitl_default --base-directory build/px4_sitl_default --gcov-tool gcov --capture -o coverage/lcov.info - - name: Upload coverage information to Codecov - if: contains(matrix.config.build_type, 'Coverage') - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: mavros_offboard - file: coverage/lcov.info diff --git a/.github/workflows/metadata.yml b/.github/workflows/metadata.yml deleted file mode 100644 index d9c90eda4772..000000000000 --- a/.github/workflows/metadata.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: Metadata - -on: - push: - branches: - - 'main' - - 'release/*' - - 'pr-metadata-test' - -jobs: - - airframe: - runs-on: ubuntu-latest - container: px4io/px4-dev-base-focal:2021-09-08 - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.ACCESS_TOKEN }} - - - name: airframe metadata - run: | - make airframe_metadata - ./src/lib/version/get_git_tag_or_branch_version.sh build/px4_sitl_default >> $GITHUB_ENV - cd build/px4_sitl_default/docs - # TODO: deploy to userguide gitbook - - - 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: 'build/px4_sitl_default/docs/' - DEST_DIR: 'Firmware/${{ env.version }}/_general/' - - module: - runs-on: ubuntu-latest - container: px4io/px4-dev-base-focal:2021-09-08 - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.ACCESS_TOKEN }} - - - name: module documentation - run: | - make module_documentation - cd build/px4_sitl_default/docs - ls -ls * - # TODO: deploy to userguide gitbook and s3 - - parameter: - runs-on: ubuntu-latest - container: px4io/px4-dev-base-focal:2021-09-08 - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.ACCESS_TOKEN }} - - - name: parameter metadata - run: | - make parameters_metadata - ./src/lib/version/get_git_tag_or_branch_version.sh build/px4_sitl_default >> $GITHUB_ENV - - - 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: 'build/px4_sitl_default/docs/' - DEST_DIR: 'Firmware/${{ env.version }}/_general/' - - events: - runs-on: ubuntu-latest - container: px4io/px4-dev-base-focal:2021-09-08 - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.ACCESS_TOKEN }} - - - name: events metadata - run: | - make extract_events - ./src/lib/version/get_git_tag_or_branch_version.sh build/px4_sitl_default >> $GITHUB_ENV - cd build/px4_sitl_default - mkdir _events_full || true - cp events/all_events_full.json.xz _events_full/all_events.json.xz - - - 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: 'build/px4_sitl_default/_events_full/' - DEST_DIR: 'Firmware/${{ env.version }}/_general/' - - uorb_graph: - runs-on: ubuntu-latest - container: px4io/px4-dev-nuttx-focal:2021-09-08 - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.ACCESS_TOKEN }} - - - name: uORB graph - run: | - make uorb_graphs - cd Tools/uorb_graph - ls -ls * - # TODO: deploy graph_px4_sitl.json to S3 px4-travis:Firmware/master/ - - ROS2_msgs: - runs-on: ubuntu-latest - container: px4io/px4-dev-base-focal:2021-09-08 - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.ACCESS_TOKEN }} - - - name: PX4 ROS2 msgs - run: | - git clone https://github.com/PX4/px4_msgs.git - rm px4_msgs/msg/*.msg - cp msg/*.msg px4_msgs/msg/ diff --git a/.github/workflows/python_checks.yml b/.github/workflows/python_checks.yml deleted file mode 100644 index 0ca89a87c5e7..000000000000 --- a/.github/workflows/python_checks.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Python CI Checks - -on: - push: - branches: - - 'main' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.ACCESS_TOKEN }} - - name: Install Python3 - run: sudo apt-get install python3 python3-setuptools python3-pip -y - - name: Install tools - run: pip3 install --user mypy types-requests flake8 - - name: Check MAVSDK test scripts with mypy - run: $HOME/.local/bin/mypy --strict test/mavsdk_tests/*.py - - name: Check MAVSDK test scripts with flake8 - run: $HOME/.local/bin/flake8 test/mavsdk_tests/*.py diff --git a/.github/workflows/sitl_tests.yml b/.github/workflows/sitl_tests.yml deleted file mode 100644 index 8729ad8b2ba4..000000000000 --- a/.github/workflows/sitl_tests.yml +++ /dev/null @@ -1,135 +0,0 @@ -name: SITL Tests - -on: - push: - branches: - - 'main' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - config: - - {model: "iris", latitude: "59.617693", longitude: "-151.145316", altitude: "48", build_type: "RelWithDebInfo" } # Alaska - # - {model: "standard_vtol", latitude: "-38.071235", longitude: "145.281220", altitude: "31", build_type: "AddressSanitizer" } # Australia - - {model: "tailsitter" , latitude: "29.660316", longitude: "-82.316658", altitude: "30", build_type: "RelWithDebInfo" } # Florida - - {model: "standard_vtol", latitude: "47.397742", longitude: "8.545594", altitude: "488", build_type: "Coverage" } # Zurich - - container: - image: px4io/px4-dev-simulation-focal:2021-09-08 - options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.ACCESS_TOKEN }} - - - name: Download MAVSDK - run: wget "https://github.com/mavlink/MAVSDK/releases/download/v$(cat test/mavsdk_tests/MAVSDK_VERSION)/libmavsdk-dev_$(cat test/mavsdk_tests/MAVSDK_VERSION)_ubuntu20.04_amd64.deb" - - name: Install MAVSDK - run: dpkg -i "libmavsdk-dev_$(cat test/mavsdk_tests/MAVSDK_VERSION)_ubuntu20.04_amd64.deb" - - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - shell: cmake -P {0} - run: | - 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@v3 - with: - path: ~/.ccache - key: sitl_tests-${{matrix.config.build_type}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: sitl_tests-${{matrix.config.build_type}}-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 = 100M" >> ~/.ccache/ccache.conf - echo "hash_dir = false" >> ~/.ccache/ccache.conf - ccache -s - ccache -z - - - name: check environment - env: - PX4_HOME_LAT: ${{matrix.config.latitude}} - PX4_HOME_LON: ${{matrix.config.longitude}} - PX4_HOME_ALT: ${{matrix.config.altitude}} - PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}} - run: | - export - ulimit -a - - name: Build PX4 - env: - PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}} - run: make px4_sitl_default - - name: ccache post-run px4/firmware - run: ccache -s - - name: Build SITL Gazebo - env: - PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}} - run: make px4_sitl_default sitl_gazebo-classic - - name: ccache post-run sitl_gazebo-classic - run: ccache -s - - name: Build MAVSDK tests - env: - PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}} - DONT_RUN: 1 - run: make px4_sitl_default sitl_gazebo-classic mavsdk_tests - - name: ccache post-run mavsdk_tests - run: ccache -s - - - name: Core dump settings - run: | - ulimit -c unlimited - echo "`pwd`/%e.core" > /proc/sys/kernel/core_pattern - - - name: Run SITL tests - env: - PX4_HOME_LAT: ${{matrix.config.latitude}} - PX4_HOME_LON: ${{matrix.config.longitude}} - PX4_HOME_ALT: ${{matrix.config.altitude}} - PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}} - run: test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early --model ${{matrix.config.model}} --upload test/mavsdk_tests/configs/sitl.json --verbose - timeout-minutes: 45 - - - name: Look at core files - if: failure() - run: gdb build/px4_sitl_default/bin/px4 px4.core -ex "thread apply all bt" -ex "quit" - - name: Upload px4 coredump - if: failure() - uses: actions/upload-artifact@v3.1.3 - with: - name: coredump - path: px4.core - - - name: Upload px4 binary - if: failure() - uses: actions/upload-artifact@v3.1.3 - with: - name: binary - path: build/px4_sitl_default/bin/px4 - - # Report test coverage - - name: Upload coverage - if: contains(matrix.config.build_type, 'Coverage') - run: | - git config --global credential.helper "" # disable the keychain credential helper - git config --global --add credential.helper store # enable the local store credential helper - echo "https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com" >> ~/.git-credentials # add credential - git config --global url."https://github.com/".insteadof git@github.com: # credentials add credential - mkdir -p coverage - lcov --directory build/px4_sitl_default --base-directory build/px4_sitl_default --gcov-tool gcov --capture -o coverage/lcov.info - - name: Upload coverage information to Codecov - if: contains(matrix.config.build_type, 'Coverage') - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: mavsdk - file: coverage/lcov.info diff --git a/.github/workflows/tiiuae-blackduck-scan.yaml b/.github/workflows/tiiuae-blackduck-scan.yaml deleted file mode 100644 index 47c9d72601c5..000000000000 --- a/.github/workflows/tiiuae-blackduck-scan.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: tiiuae-blackduck-scan - -on: - push: - tags: - - 'v1.14.0-*' - workflow_dispatch: - -jobs: - scan: - name: run blackduck scan - runs-on: ubuntu-latest - steps: - - name: Checkout px4-firmware - uses: actions/checkout@v4 - with: - token: ${{ secrets.GH_REPO_TOKEN }} - submodules: 'recursive' - path: px4-firmware - fetch-depth: 0 - - name: Run the scan - run: | - set -exu - - # initialise configuration values - bd_project_name=px4-1.14.0 - bd_project_version=${{ github.ref_name }} - bd_project_phase=DEVELOPMENT - workdir=$(pwd) - blackduck_url="https://blackduck.ssrc.fi" - blackduck_token=${{ secrets.BLACKDUCK_ACCESS_TOKEN }} - project_id="7900cb41-3b7e-4985-8935-5d6c6b996db3" - bdscan_output_file=bdscan_output.log - - # run the actual scan - bash <(curl -s -L https://detect.synopsys.com/detect8.sh) \ - --blackduck.api.token=$blackduck_token \ - --blackduck.trust.cert=true \ - --blackduck.url=$blackduck_url \ - --detect.blackduck.signature.scanner.snippet.matching=FULL_SNIPPET_MATCHING \ - --detect.blackduck.signature.scanner.upload.source.mode=true \ - --detect.excluded.detector.types=PEAR \ - --detect.impact.analysis.enabled=true \ - --detect.project.application.id=$bd_project_name \ - --detect.project.name=$bd_project_name \ - --detect.project.version.name=$bd_project_version \ - --detect.project.version.phase=$bd_project_phase \ - --detect.source.path=$workdir \ - --detect.target.type=SOURCE \ - --detect.timeout=6000 \ - --detect.tools=ALL \ - --detect.wait.for.results=true \ - | tee ${bdscan_output_file} - - # find blackduck link from output log: - grep 'Black Duck Project BOM:' ${bdscan_output_file} |sed 's/^.*Black Duck Project BOM: //g' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/tiiuae-builder-images.yaml b/.github/workflows/tiiuae-builder-images.yaml deleted file mode 100644 index 14f699106c87..000000000000 --- a/.github/workflows/tiiuae-builder-images.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: tiiuae-builder-images - -on: - # Run only manually - workflow_dispatch: - -permissions: - contents: read - packages: write - -jobs: - hw-builder-image: - name: create docker builder base image - runs-on: ubuntu-latest - steps: - - name: Checkout px4-firmware - uses: actions/checkout@v4 - with: - path: px4-firmware - fetch-depth: 0 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/tiiuae/px4-firmware-builder-base - tags: | - type=raw,value=latest - type=sha - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build builder base image and push - uses: docker/build-push-action@v5 - with: - context: . - file: ./px4-firmware/packaging/Dockerfile.build_env_pre - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/tiiuae-check-format.yml b/.github/workflows/tiiuae-check-format.yml deleted file mode 100644 index 717e5b4189ef..000000000000 --- a/.github/workflows/tiiuae-check-format.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Make check_format before PULLREQUEST. - - -name: check_format - -on: [pull_request] - -jobs: - main: - name: Validate testfile - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Lint - run: | - sudo apt update -y && sudo apt install -y --no-install-recommends make astyle - make check_format diff --git a/.github/workflows/tiiuae-codeql.yaml b/.github/workflows/tiiuae-codeql.yaml new file mode 100644 index 000000000000..9297ad5acf87 --- /dev/null +++ b/.github/workflows/tiiuae-codeql.yaml @@ -0,0 +1,42 @@ +name: "CodeQL" + +on: + push: + 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 diff --git a/.github/workflows/tiiuae-coverity-scan-image.yaml b/.github/workflows/tiiuae-coverity-scan-image.yaml deleted file mode 100644 index 34db9e3a188c..000000000000 --- a/.github/workflows/tiiuae-coverity-scan-image.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: tiiuae-coverity-scan-image - -on: - # Run only manually - workflow_dispatch: - -permissions: - contents: read - packages: write - -jobs: - coverity-scan-image: - name: create coverity scan image - runs-on: ubuntu-latest - steps: - - name: Checkout px4-firmware - uses: actions/checkout@v4 - with: - path: px4-firmware - fetch-depth: 0 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/tiiuae/px4-coverity-scan-image - tags: | - type=raw,value=latest - type=sha - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push coverity scan image - uses: docker/build-push-action@v5 - with: - context: . - file: ./px4-firmware/packaging/Dockerfile.coverity - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - "COVERITY_DOCKER_REGISTRY_USERNAME=${{ secrets.COVERITY_DOCKER_REGISTRY_USERNAME }}" - "COVERITY_DOCKER_REGISTRY_ACCESS_TOKEN=${{ secrets.COVERITY_DOCKER_REGISTRY_ACCESS_TOKEN }}" - "COVERITY_LICENSE_DAT_B64=${{ secrets.COVERITY_LICENSE_DAT_B64 }}" - "COVERITY_ACCESS_TOKEN_B64=${{ secrets.COVERITY_ACCESS_TOKEN_B64 }}" diff --git a/.github/workflows/tiiuae-coverity-scan.yaml b/.github/workflows/tiiuae-coverity-scan.yaml deleted file mode 100644 index 13b6ec68f898..000000000000 --- a/.github/workflows/tiiuae-coverity-scan.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: tiiuae-px4-coverity-scan - -on: - workflow_dispatch: - pull_request: - branches: [ main ] -jobs: - coverity: - runs-on: px4-self-hosted-coverity - steps: - - name: Checkout px4-firmware - uses: actions/checkout@v4 - with: - token: ${{ secrets.GH_REPO_TOKEN }} - submodules: 'recursive' - fetch-depth: 0 - - name: Fetch submodule tags - run: | - git submodule foreach --recursive git fetch --tags - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Run coverity scan - run: - docker run --rm -v "$(pwd):/main_ws" ghcr.io/tiiuae/px4-coverity-scan-image:latest - - name: Update summary - run: - cat cov-analyze-result.txt >> $GITHUB_STEP_SUMMARY - - name: Upload coverity scan results - uses: actions/upload-artifact@v3.1.3 - with: - name: coverity-html-report-${{ github.event.repository.name }} - path: coverity-output diff --git a/.github/workflows/tiiuae-pixhawk-and-saluki-builder.yaml b/.github/workflows/tiiuae-pixhawk-and-saluki-builder.yaml deleted file mode 100644 index b865d9ebb010..000000000000 --- a/.github/workflows/tiiuae-pixhawk-and-saluki-builder.yaml +++ /dev/null @@ -1,46 +0,0 @@ -on: - workflow_call: - inputs: - product: - required: true - type: string - keys: - required: true - type: string - enabled: - required: false - type: boolean - default: true - secrets: - GH_REPO_TOKEN: - required: false -jobs: - build: - runs-on: ubuntu-latest - if: ${{ inputs.enabled }} - steps: - - name: Checkout px4-firmware - uses: actions/checkout@v4 - with: - token: ${{ secrets.GH_REPO_TOKEN }} - # if we clone_public, then do not clone submodules, otherwise 'recursive' - submodules: ${{ inputs.clone_public == true && 'false' || 'recursive' }} - path: px4-firmware - fetch-depth: 0 - - name: Run px4-firmware ${{ inputs.product }} build - run: | - set -eux - if [ -n ${{ inputs.keys }} ]; then - export SIGNING_ARGS=${{ inputs.keys }} - fi - mkdir -p bin - cd px4-firmware/ - # run clone_public.sh if clone_public flag is provided - ./clone_public.sh - ./build.sh ../bin/ ${{ inputs.product }} - - name: Upload ${{ inputs.product }} - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs.product }} - path: bin/ - retention-days: 1 diff --git a/.github/workflows/tiiuae-pixhawk-and-saluki.yaml b/.github/workflows/tiiuae-pixhawk-and-saluki.yaml deleted file mode 100644 index 4b14fe7578a0..000000000000 --- a/.github/workflows/tiiuae-pixhawk-and-saluki.yaml +++ /dev/null @@ -1,456 +0,0 @@ -name: tiiuae-pixhawk-and-saluki - -on: - push: - branches: [ main ] - tags: - - 'v1.14.0-*' - pull_request: - branches: [ main ] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - inputs: - jfrog-upload: - description: 'upload to Artifactory' - required: false - default: false - type: boolean - saluki-v2-manual-fpga-version: - description: 'saluki-v2 optional fpga version (e.g. sha-3b85ccc)' - required: false - default: '' - type: string - saluki-v3-manual-fpga-version: - description: 'saluki-v3 optional fpga version (e.g. sha-3b85ccc)' - required: false - default: '' - type: string - saluki-pi-manual-fpga-version: - description: 'saluki-pi optional fpga version (e.g. sha-cd7bb6b)' - required: false - default: '' - type: string - -permissions: - contents: read - packages: write - -env: - saluki_fpga_repo: "ghcr.io/tiiuae/saluki-fpga" - saluki_pi_fpga_version: "4.10.0" - saluki_v2_fpga_version: "4.10.0" - saluki_v3_fpga_version: "4.10.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, saluki-nxp93_flat] - include: - - product: saluki-v2_custom_keys - keys: Tools/saluki-sec-scripts/custom_keys/saluki-v2/px4_bin_ed25519_private.pem - - product: saluki-v3_custom_keys - keys: Tools/saluki-sec-scripts/custom_keys/saluki-v3/px4_bin_ed25519_private.pem - - product: saluki-pi_custom_keys - keys: Tools/saluki-sec-scripts/custom_keys/saluki-pi/px4_bin_ed25519_private.pem - - uses: ./.github/workflows/tiiuae-pixhawk-and-saluki-builder.yaml - with: - product: ${{ matrix.product }} - keys: ${{ matrix.keys }} - # old workflow had condition to run only if PR is done to current repo (or triggered with other event) - enabled: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - secrets: inherit - - variables: - runs-on: ubuntu-latest - outputs: - jfrog_upload: ${{ steps.variables.outputs.jfrog_upload }} - 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 }} - steps: - - name: Print input variables - id: variables - run: | - # use saluki-v2-fpga default version if custom is not provided - saluki_v2_fpga_version=${{ env.saluki_v2_fpga_version }} - if [ -n "${{ github.event.inputs.saluki-v2-manual-fpga-version }}" ]; then - saluki_v2_fpga_version=${{ github.event.inputs.saluki-v2-manual-fpga-version }} - fi - - # use saluki-v3-fpga default version if custom is not provided - saluki_v3_fpga_version=${{ env.saluki_v3_fpga_version }} - if [ -n "${{ github.event.inputs.saluki-v3-manual-fpga-version }}" ]; then - saluki_v3_fpga_version=${{ github.event.inputs.saluki-v3-manual-fpga-version }} - fi - - # use saluki-pi-fpga default version if custom is not provided - saluki_pi_fpga_version=${{ env.saluki_pi_fpga_version }} - if [ -n "${{ github.event.inputs.saluki-pi-manual-fpga-version }}" ]; then - saluki_pi_fpga_version=${{ github.event.inputs.saluki-pi-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 "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 "jfrog_upload: ${{ github.event.inputs.jfrog-upload }}" - - px4fwupdater: - name: build px4fwupdater - runs-on: ubuntu-latest - needs: - - fc_matrix - steps: - - name: Checkout px4-firmware - uses: actions/checkout@v4 - with: - path: px4-firmware - fetch-depth: 0 - - name: Download pixhawk artifacts - uses: actions/download-artifact@v4 - with: - pattern: saluki-* - path: bin - merge-multiple: true - - name: Run px4-firmware px4fwupdater build - run: | - set -eux - mkdir -p bin - cd px4-firmware/ - ./clone_public.sh - ./build.sh ../bin/ px4fwupdater - ls ../bin - - name: Upload px4fwupdater to tmp storage - uses: actions/upload-artifact@v4 - with: - name: pixhawk - path: bin/ - retention-days: 1 - overwrite: true - - upload-px4fwupdater: - name: upload px4fwupdater to docker registry - runs-on: ubuntu-latest - env: - FPGA_DIR: fpga - needs: - - px4fwupdater - - variables - steps: - - name: Checkout px4-firmware - uses: actions/checkout@v4 - with: - path: px4-firmware - fetch-depth: 0 - - name: Download pixhawk artifacts - uses: actions/download-artifact@v4 - with: - path: bin - pattern: saluki-* - merge-multiple: true - - name: Firmware flasher - Container metadata - id: containermeta # referenced from later step - uses: docker/metadata-action@v5 - with: - images: ghcr.io/tiiuae/px4-firmware - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=sha - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - 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 - - # 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: . - file: px4-firmware/Tools/px_uploader.Dockerfile - tags: ${{ steps.containermeta.outputs.tags }} - labels: ${{ steps.containermeta.outputs.labels }} - build-args: | - "saluki_fpga_directory=${{ env.FPGA_DIR }}" - - name: Build overview - run: | - echo "### Build overview:" >> $GITHUB_STEP_SUMMARY - echo "Build version: ${{ steps.containermeta.outputs.tags }}" - echo "Build labels: ${{ steps.containermeta.outputs.labels }}" - echo "Build args:" - 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 }}" - - # 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 - container_name=$(echo "${{ steps.containermeta.outputs.tags }}" | grep ':sha-' | head -n 1) - else - container_name="${{ steps.containermeta.outputs.tags }}" - fi - echo "Container name: $container_name" - - # display mermaid flowchart - echo '```mermaid' >> $GITHUB_STEP_SUMMARY - echo "flowchart LR" >> $GITHUB_STEP_SUMMARY - - # inputs - 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 "PX4-SHA[${{ github.repository }}\n$GITHUB_REF]" >> $GITHUB_STEP_SUMMARY - - # build - echo "BUILD[build PX4 fwupdater]" >> $GITHUB_STEP_SUMMARY - - # outputs - echo "OUTPUT[(${container_name})]" >> $GITHUB_STEP_SUMMARY - - # links - echo "PX4-SHA --> BUILD" >> $GITHUB_STEP_SUMMARY - echo "FPGA-V2 --> BUILD" >> $GITHUB_STEP_SUMMARY - echo "FPGA-V3 --> BUILD" >> $GITHUB_STEP_SUMMARY - echo "FPGA-PI --> BUILD" >> $GITHUB_STEP_SUMMARY - echo "BUILD --> OUTPUT" >> $GITHUB_STEP_SUMMARY - # end mermaid flowchart - echo '```' >> $GITHUB_STEP_SUMMARY - - # set variables for container name and date - CONTAINER_DATE=$(date +%s) - PX4_TMP_CONTAINER_NAME="tmp_px4_container_$CONTAINER_DATE" - px4_github_sha=$(echo "${{ github.sha }}" | cut -c1-7) - - echo "# Flashing this package to your Saluki" >> $GITHUB_STEP_SUMMARY - echo "## Get these px4 firmware files to your computer" >> $GITHUB_STEP_SUMMARY - echo "To get these files to you computer, you can use the following command" >> $GITHUB_STEP_SUMMARY - echo "The command will create a temporary \`$PX4_TMP_CONTAINER_NAME\` container, copy the firmware files to directory \`px4-firmware_${px4_github_sha}\` and remove the temporary container" >> $GITHUB_STEP_SUMMARY - - # compose docker cp command - docker_cp_cmd='docker cp $(docker create --name ' - docker_cp_cmd+="$PX4_TMP_CONTAINER_NAME $container_name" - docker_cp_cmd+='):/firmware ' - docker_cp_cmd+=px4-firmware_${px4_github_sha} - docker_cp_cmd+=' && docker rm ' - docker_cp_cmd+=$PX4_TMP_CONTAINER_NAME - - # echo docker cp command to summary - echo '```shell' >> $GITHUB_STEP_SUMMARY - echo "${docker_cp_cmd}" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - - # This flashing is not currently working, just keeping it here for the future - # echo "## Flash this px4 firmware to your Saluki" >> $GITHUB_STEP_SUMMARY - # echo "To flash this firmware to your Saluki, you can use the following command:" >> $GITHUB_STEP_SUMMARY - # docker_flash_cmd='docker run --rm --network=host --entrypoint= --device=${dev}:/dev/px4serial ' - # docker_flash_cmd+=$container_name - # docker_flash_cmd+=' sh -c "/bin/px_uploader.py ssrc_saluki-v2_default-*.px4"' - # echo '```shell' >> $GITHUB_STEP_SUMMARY - # echo "${docker_flash_cmd}" >> $GITHUB_STEP_SUMMARY - # echo '```' >> $GITHUB_STEP_SUMMARY - - # separator - echo '---' >> $GITHUB_STEP_SUMMARY - - echo "## Flash this px4 firmware to your Saluki by using fpga-flashing tool" >> $GITHUB_STEP_SUMMARY - echo "fpga-flashing is separate tool: https://github.com/tiiuae/fpga-flashing/" >> $GITHUB_STEP_SUMMARY - echo "### Flash px4 firmware" >> $GITHUB_STEP_SUMMARY - echo "To flash this px4 firmware and FPGA to your Saluki with fpga-flashing, you can use the following command:" >> $GITHUB_STEP_SUMMARY - flash_tool_cmd='./flash.sh --update-package ' - flash_tool_cmd+=$container_name - flash_tool_cmd+=' --px4' - echo '```shell' >> $GITHUB_STEP_SUMMARY - echo "${flash_tool_cmd}" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - - # separator - echo '---' >> $GITHUB_STEP_SUMMARY - - echo "### Zeroize and flash FPGA and PX4" >> $GITHUB_STEP_SUMMARY - echo "To zeroize the device as new and flash px4 firmware, FPGA and RD certificate to your Saluki with fpga-flashing -tool, you can use the following command:" >> $GITHUB_STEP_SUMMARY - echo "please notice that FPGA flashing needs FlashPro connected" >> $GITHUB_STEP_SUMMARY - flash_tool_cmd='./flash.sh --update-package ' - flash_tool_cmd+=$container_name - flash_tool_cmd+=' --zeroize --fpga --px4 --rdc' - echo '```shell' >> $GITHUB_STEP_SUMMARY - echo "${flash_tool_cmd}" >> $GITHUB_STEP_SUMMARY - 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 - if: false - runs-on: ubuntu-latest - needs: - - px4fwupdater - - variables - steps: - - name: Checkout px4-firmware - uses: actions/checkout@v4 - with: - path: px4-firmware - fetch-depth: 0 - - name: Download pixhawk artifacts - uses: actions/download-artifact@v4 - with: - pattern: pixhawk - path: bin - - name: Firmware flasher - Container metadata - id: containermeta # referenced from later step - uses: docker/metadata-action@v5 - with: - images: artifactory.ssrcdevops.tii.ae/tiiuae/px4-firmware - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=sha - - name: Login to SSRC JFrog Container Registry - uses: docker/login-action@v3 - with: - registry: artifactory.ssrcdevops.tii.ae - username: ${{ secrets.UAE_RT_USER }} - password: ${{ secrets.UAE_RT_APIKEY }} - # have to login to ghcr as well to download fpga and BL - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Firmware flasher - Build and push - uses: docker/build-push-action@v5 - with: - push: true - context: . - 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 }}" - - artifactory-uae: - name: upload builds to UAE artifactory - if: ${{ github.event_name != 'workflow_dispatch' || inputs.jfrog-upload == true }} - runs-on: ubuntu-latest - needs: - - px4fwupdater - - fc_matrix - steps: - - name: Download pixhawk artifacts - uses: actions/download-artifact@v4 - with: - path: bin - merge-multiple: true - - uses: jfrog/setup-jfrog-cli@v4 - env: - JF_ENV_1: ${{ secrets.UAE_ARTIFACTORY_TOKEN }} - - name: Upload px4-firmware build to Artifactory - env: - ARTIFACTORY_GEN_REPO: gen-public-local - BUILD_NAME_PX4: px4-firmware - CI: true - run: | - set -exu - - pr_or_empty="" - latest_link="" - if [ ${{ github.event_name }} == 'pull_request' ]; then - latest_link="pr/" - pr_or_empty="pr/${{ github.head_ref || github.ref_name }}/" - fi - - newline=$'\n' - artifactory_links="| target | link | - |--------|------|" - artifactory_base_url="https://artifactory.ssrcdevops.tii.ae/artifactory/" - - for pkg in $(find bin -type f|sort); do - - file_name=$(basename $pkg) - ext="${file_name##*.}" - target_path="" - pkg_name=$(echo $file_name | sed -r -e 's/-[0-9]+\.[0-9]+\.[0-9]+-.*//g') - - if [[ $file_name = px4_fmu* ]]; then - target_path="pixhawk" - elif [[ $file_name = ssrc_saluki* ]]; then - target_path="saluki" - else - echo "$pkg ignored" - continue - fi - - artifactory_path=$ARTIFACTORY_GEN_REPO/builds/px4-firmware/${target_path}/${pr_or_empty} - artifactory_latest_path=$ARTIFACTORY_GEN_REPO/builds/px4-firmware/${target_path}/${latest_link}latest/${pkg_name}.${ext} - - jfrog rt u --target-props COMMIT="$GITHUB_SHA" \ - --build-name "$BUILD_NAME_PX4" \ - --build-number "$GITHUB_SHA" \ - "$pkg" \ - "${artifactory_path}$file_name" - - # link to latest - jfrog rt cp --flat \ - "${artifactory_path}$file_name" \ - "${artifactory_latest_path}" - - # append every file to artifactory_links - artifactory_links+="${newline}| ${pkg_name} | ${artifactory_base_url}${artifactory_path}${file_name} |" - done - - # export artifactory linds as gh step summary - echo "### UAE Artifactory links:" >> $GITHUB_STEP_SUMMARY - echo "${artifactory_links}" >> $GITHUB_STEP_SUMMARY - - - name: Upload px4-fwupdater build to Artifactory - # disabled as token doesnt allow deb upload - if: false - env: - ARTIFACTORY_DEB_REPO: debian-public-local - DISTRIBUTION: focal - COMPONENT: fog-sw - ARCHITECTURE: amd64 - BUILD_NAME_DEB: px4-fwupdater - CI: true - run: | - set -exu - pkg=$(find bin -name 'px4fwupdater*.deb') - pkg_name=$(basename $pkg) - jfrog rt u --deb "$DISTRIBUTION/$COMPONENT/$ARCHITECTURE" \ - --target-props COMMIT="$GITHUB_SHA" \ - --build-name "$BUILD_NAME_DEB" \ - --build-number "$GITHUB_SHA" \ - "$pkg" \ - "$ARTIFACTORY_DEB_REPO/$pkg_name" diff --git a/.github/workflows/tiiuae-sitl-gzsim.yaml b/.github/workflows/tiiuae-sitl-gzsim.yaml deleted file mode 100644 index bc69ce5bf469..000000000000 --- a/.github/workflows/tiiuae-sitl-gzsim.yaml +++ /dev/null @@ -1,63 +0,0 @@ -name: tii-px4-sitl-gzsim - -on: - push: - branches: [ main ] - pull_request: - -permissions: - contents: read - packages: write - -jobs: - tii-px4-sitl-gzsim: - runs-on: ubuntu-latest - steps: - - - name: Checkout px4-firmware - uses: actions/checkout@v4 - with: - path: px4-firmware - fetch-depth: 0 - - - uses: docker/setup-buildx-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - driver-opts: network=host - - - name: Prepare px4-firmware - run: | - set -eux - cd px4-firmware - ./clone_public.sh - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/tiiuae/tii-px4-sitl-gzsim - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=sha - type=raw,value=latest - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build tii-px4-sitl-gzsim image and push - uses: docker/build-push-action@v5 - with: - context: . - file: ./px4-firmware/packaging/Dockerfile.sitl_gzsim - pull: true - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/tiiuae-sitl-tests.yml b/.github/workflows/tiiuae-sitl-tests.yml deleted file mode 100644 index 2b05a5ee7cdf..000000000000 --- a/.github/workflows/tiiuae-sitl-tests.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: SITL Tests - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -permissions: - contents: read - packages: write - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - config: - - {model: "iris", latitude: "59.617693", longitude: "-151.145316", altitude: "48", build_type: "RelWithDebInfo" } # Alaska - container: - image: ghcr.io/tiiuae/px4-firmware-builder-base:latest - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.GH_REPO_TOKEN }} - fetch-depth: 0 - - name: Install dependencies - run: | - apt update -y && apt install -y --no-install-recommends wget - pip3 install requests - git config --global --add safe.directory '*' - - name: Download MAVSDK - run: wget "https://github.com/mavlink/MAVSDK/releases/download/v$(cat test/mavsdk_tests/MAVSDK_VERSION)/libmavsdk-dev_$(cat test/mavsdk_tests/MAVSDK_VERSION)_ubuntu20.04_amd64.deb" - - name: Install MAVSDK - run: dpkg -i "libmavsdk-dev_$(cat test/mavsdk_tests/MAVSDK_VERSION)_ubuntu20.04_amd64.deb" - - name: check environment - env: - PX4_HOME_LAT: ${{matrix.config.latitude}} - PX4_HOME_LON: ${{matrix.config.longitude}} - PX4_HOME_ALT: ${{matrix.config.altitude}} - PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}} - run: | - export - - name: Build PX4 - env: - PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}} - run: make px4_sitl_default - - name: Build SITL Gazebo - env: - PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}} - run: | - . /opt/ros/humble/setup.sh - make px4_sitl_default sitl_gazebo-classic - - name: Build MAVSDK tests - env: - PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}} - DONT_RUN: 1 - run: make px4_sitl_default sitl_gazebo-classic mavsdk_tests - - name: Run SITL tests - env: - PX4_HOME_LAT: ${{matrix.config.latitude}} - PX4_HOME_LON: ${{matrix.config.longitude}} - PX4_HOME_ALT: ${{matrix.config.altitude}} - PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}} - run: test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early --model ${{matrix.config.model}} --upload test/mavsdk_tests/configs/sitl.json --verbose - timeout-minutes: 45 diff --git a/.github/workflows/tiiuae-sitl.yaml b/.github/workflows/tiiuae-sitl.yaml deleted file mode 100644 index a4b30061aa64..000000000000 --- a/.github/workflows/tiiuae-sitl.yaml +++ /dev/null @@ -1,72 +0,0 @@ -name: tii-px4-sitl - -on: - push: - branches: [ main ] - pull_request: - -permissions: - contents: read - packages: write - -jobs: - tii-px4-sitl: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - - name: Checkout px4-firmware - uses: actions/checkout@v4 - with: - path: px4-firmware - fetch-depth: 0 - - - uses: docker/setup-buildx-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - driver-opts: network=host - - # Run docker build - - name: Run fog-sw docker build - run: | - set -eux - mkdir bin - cd px4-firmware - ./clone_public.sh - ./build_sitl.sh ../bin/ - ls ../bin/ - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/tiiuae/tii-px4-sitl - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=sha - type=raw,value=latest - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build tii-px4-sitl image and push - uses: docker/build-push-action@v5 - with: - context: . - file: ./px4-firmware/packaging/Dockerfile.sitl - pull: true - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }}