From 89b7df644ee38d8dbc9accac6a16d12773e4f922 Mon Sep 17 00:00:00 2001 From: Jonatan Antoni Date: Thu, 4 Apr 2024 14:06:47 +0200 Subject: [PATCH 1/2] Add GitHub Action workflow for RTOS2 Validation --- .github/workflows/cmsis_rv2.yaml | 156 +++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 .github/workflows/cmsis_rv2.yaml diff --git a/.github/workflows/cmsis_rv2.yaml b/.github/workflows/cmsis_rv2.yaml new file mode 100644 index 00000000..9672167d --- /dev/null +++ b/.github/workflows/cmsis_rv2.yaml @@ -0,0 +1,156 @@ + +name: RTOS2 Validation + +on: + workflow_dispatch: + pull_request: + push: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + CMSIS_PACK_ROOT: ${{ github.workspace }}/.packs + ARM_UBL_ACTIVATION_CODE: ${{ secrets.ARM_UBL_ACTIVATION_CODE }} + +jobs: + build-and-run: + strategy: + fail-fast: true + matrix: + compiler: [AC6, GCC, Clang] + + runs-on: ubuntu-latest + + steps: + - name: Checkout CMSIS-FreeRTOS + uses: actions/checkout@v4 + with: + path: CMSIS-FreeRTOS + fetch-depth: 0 + + - name: Checkout CMSIS_6 + uses: actions/checkout@v4 + with: + repository: ARM-software/CMSIS_6 + path: CMSIS_6 + + - name: Checkout CMSIS-RTOS2_Validation + uses: actions/checkout@v4 + with: + repository: ARM-software/CMSIS-RTOS2_Validation + path: CMSIS-RTOS2_Validation + + - name: Checkout Cortex_DFP + uses: actions/checkout@v4 + with: + repository: ARM-software/Cortex_DFP + path: Cortex_DFP + + - name: Setup Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install system packages + run: | + sudo add-apt-repository ppa:deadsnakes/ppa + sudo apt-get install libpython3.9 libtinfo5 + + - name: Python requirements + run: | + pip install -r ./CMSIS-RTOS2_Validation/Project/requirements.txt + + - name: Cache packs + uses: actions/cache@v4 + with: + key: packs-${{ github.run_id }}-${{ matrix.compiler }} + restore-keys: | + packs- + path: /home/runner/.cache/arm/packs + + - name: Setup vcpkg environment + uses: JonatanAntoni/actions/vcpkg@main + with: + config: ./CMSIS-RTOS2_Validation/Project/vcpkg-configuration.json + cache: "-${{ matrix.compiler }}" + + - name: Activate Arm tool license + run: | + if [[ -n "${{ env.ARM_UBL_ACTIVATION_CODE }}" ]]; then + armlm activate --code ${{ env.ARM_UBL_ACTIVATION_CODE }} + else + armlm activate --server https://mdk-preview.keil.arm.com --product KEMDK-COM0 + fi + + - name: Register local packs + run: | + cpackget init https://www.keil.com/pack/index.pidx + cpackget rm ARM::CMSIS ARM::CMSIS-FreeRTOS ARM::Cortex_DFP || echo "Ok" + + cpackget add ./CMSIS_6/ARM.CMSIS.pdsc + cpackget add ./CMSIS-FreeRTOS/ARM.CMSIS-FreeRTOS.pdsc + cpackget add ./Cortex_DFP/ARM.Cortex_DFP.pdsc + cpackget add -an ARM.CMSIS-RTX + + - uses: ammaraskar/gcc-problem-matcher@master + if: matrix.compiler == 'GCC' + + - name: Build + working-directory: ./CMSIS-RTOS2_Validation/Project + run: | + echo "Build test projects ..." + ./build.py --verbose -r FreeRTOS -c ${{ matrix.compiler }} build || echo "::warning::=== Some configurations failed to build! ===" + + - name: Execute + if: ${{ env.ARM_UBL_ACTIVATION_CODE }} + working-directory: ./CMSIS-RTOS2_Validation/Project + run: | + echo "Run test projects ..." + ./build.py --verbose -r FreeRTOS -c ${{ matrix.compiler }} run || echo "::warning::==== Some configurations failed to run! ===" + + - name: Deactivate Arm tool license + if: always() + working-directory: ./CMSIS-RTOS2_Validation/Project + run: | + if [[ -n "${{ env.ARM_UBL_ACTIVATION_CODE }}" ]]; then + armlm deactivate --code ${{ env.ARM_UBL_ACTIVATION_CODE }} + else + armlm deactivate --product KEMDK-COM0 + fi + + - name: Upload Test Reports + if: ${{ !cancelled() && env.ARM_UBL_ACTIVATION_CODE }} + uses: actions/upload-artifact@v4 + with: + name: test-results-${{ matrix.compiler }} + path: ./CMSIS-RTOS2_Validation/Project/*.junit + + + publish-test-results: + needs: [build-and-run] + runs-on: ubuntu-22.04 + if: github.event_name == 'pull_request' + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: Download Test Reports + if: ${{ env.ARM_UBL_ACTIVATION_CODE }} + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Publish Test Results + if: ${{ env.ARM_UBL_ACTIVATION_CODE && env.GITHUB_TOKEN }} + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + commit: ${{ github.event.workflow_run.head_sha }} + event_file: ${{ github.event_path }} + report_individual_runs: true + event_name: ${{ github.event.workflow_run.event }} + files: "artifacts/**/*.junit" + \ No newline at end of file From c36fdb1ea6f56613187ba950ec98acc03b773aa1 Mon Sep 17 00:00:00 2001 From: Jonatan Antoni Date: Thu, 4 Apr 2024 15:41:34 +0200 Subject: [PATCH 2/2] Remove condition from execution and publish steps --- .github/workflows/cmsis_rv2.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmsis_rv2.yaml b/.github/workflows/cmsis_rv2.yaml index 9672167d..9568681d 100644 --- a/.github/workflows/cmsis_rv2.yaml +++ b/.github/workflows/cmsis_rv2.yaml @@ -105,7 +105,6 @@ jobs: ./build.py --verbose -r FreeRTOS -c ${{ matrix.compiler }} build || echo "::warning::=== Some configurations failed to build! ===" - name: Execute - if: ${{ env.ARM_UBL_ACTIVATION_CODE }} working-directory: ./CMSIS-RTOS2_Validation/Project run: | echo "Run test projects ..." @@ -122,7 +121,7 @@ jobs: fi - name: Upload Test Reports - if: ${{ !cancelled() && env.ARM_UBL_ACTIVATION_CODE }} + if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: name: test-results-${{ matrix.compiler }} @@ -139,13 +138,12 @@ jobs: steps: - name: Download Test Reports - if: ${{ env.ARM_UBL_ACTIVATION_CODE }} uses: actions/download-artifact@v4 with: path: artifacts - name: Publish Test Results - if: ${{ env.ARM_UBL_ACTIVATION_CODE && env.GITHUB_TOKEN }} + if: ${{ env.GITHUB_TOKEN }} uses: EnricoMi/publish-unit-test-result-action@v2 with: commit: ${{ github.event.workflow_run.head_sha }}