From 4d33286da5994d16a1eaf317e15f4f5189d15c8f Mon Sep 17 00:00:00 2001 From: Jonatan Antoni Date: Fri, 24 Nov 2023 12:12:46 +0100 Subject: [PATCH] Update workflows and build scripts --- .github/workflows/core.yml | 25 +++++++++++++++++++++++-- .github/workflows/corevalidation.yml | 25 ++++++++++++++++++++++++- CMSIS/Core/Test/build.py | 4 ---- CMSIS/CoreValidation/Project/build.py | 5 ----- 4 files changed, 47 insertions(+), 12 deletions(-) diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index 1e9c2286b..3e200a922 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -14,6 +14,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + IAR_VERSION: '9.40.2' + jobs: lit: runs-on: ubuntu-latest @@ -36,7 +39,7 @@ jobs: - name: Cache vcpkg uses: actions/cache@v3 with: - key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ matrix.compiler }} + key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }} restore-keys: | vcpkg-${{ runner.os }}-${{ runner.arch }}- path: /home/runner/.vcpkg @@ -54,7 +57,25 @@ jobs: . <(curl https://aka.ms/vcpkg-init.sh -L) vcpkg x-update-registry --all vcpkg activate - + + - name: Cache IAR Toolchain + uses: actions/cache@v3 + with: + key: bxarm-${{env.IAR_VERSION}}-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }} + restore-keys: | + bxarm-${{env.IAR_VERSION}}-${{ runner.os }}-${{ runner.arch }}- + path: bxarm-${{env.IAR_VERSION}}.deb + + - name: Install IAR Toolchain + run: | + if [ ! -f bxarm-${{env.IAR_VERSION}}.deb ]; then + curl -LO http://files.iar.com/ftp/pub/box/bxarm-${{env.IAR_VERSION}}.deb + fi + dpkg -i bxarm-${{env.IAR_VERSION}}.deb + echo "/opt/iarsystems/bxarm/arm/bin" >> "$GITHUB_PATH" + echo "IAR_TOOLCHAIN_${IAR_VERSION//./_}=/opt/iarsystems/bxarm/arm/bin" >> "$GITHUB_ENV" + # TODO: activate license + - name: Activate Arm tool license working-directory: ./CMSIS/Core/Test run: | diff --git a/.github/workflows/corevalidation.yml b/.github/workflows/corevalidation.yml index 014d2726b..dad5d5367 100644 --- a/.github/workflows/corevalidation.yml +++ b/.github/workflows/corevalidation.yml @@ -15,13 +15,16 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + IAR_VERSION: '9.40.2' + jobs: build-and-run: strategy: fail-fast: true matrix: - compiler: [AC6, GCC, Clang] + compiler: [AC6, GCC, Clang, IAR] runs-on: ubuntu-latest @@ -78,6 +81,26 @@ jobs: vcpkg x-update-registry --all vcpkg activate + - name: Cache IAR Toolchain + uses: actions/cache@v3 + if: matrix.compiler == 'IAR' + with: + key: bxarm-${{env.IAR_VERSION}}-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }} + restore-keys: | + bxarm-${{env.IAR_VERSION}}-${{ runner.os }}-${{ runner.arch }}- + path: bxarm-${{env.IAR_VERSION}}.deb + + - name: Install IAR Toolchain + if: matrix.compiler == 'IAR' + run: | + if [ ! -f bxarm-${{env.IAR_VERSION}}.deb ]; then + curl -LO http://files.iar.com/ftp/pub/box/bxarm-${{env.IAR_VERSION}}.deb + fi + dpkg -i bxarm-${{env.IAR_VERSION}}.deb + echo "/opt/iarsystems/bxarm/arm/bin" >> "$GITHUB_PATH" + echo "IAR_TOOLCHAIN_${IAR_VERSION//./_}=/opt/iarsystems/bxarm/arm/bin" >> "$GITHUB_ENV" + # TODO: activate license + - name: Activate Arm tool license working-directory: ./CMSIS/CoreValidation/Project run: | diff --git a/CMSIS/Core/Test/build.py b/CMSIS/Core/Test/build.py index 110824216..ecaf6aad8 100755 --- a/CMSIS/Core/Test/build.py +++ b/CMSIS/Core/Test/build.py @@ -73,10 +73,6 @@ def run_lit(toolchain, device, optimize, extra_args = None): extra_args = ["."] return ["lit", "--xunit-xml-output", f"lit-{toolchain}-{optimize}-{device}.xunit", "-D", f"toolchain={toolchain}", "-D", f"device={device}", "-D", f"optimize={optimize}"]+extra_args -# @matrix_filter -# def filter_iar(config): -# return config.compiler == CompilerAxis.IAR - @matrix_filter def filter_gcc_cm85(config): return config.compiler == CompilerAxis.GCC and config.device.match('CM85*') diff --git a/CMSIS/CoreValidation/Project/build.py b/CMSIS/CoreValidation/Project/build.py index d329edaa0..fefe393f5 100755 --- a/CMSIS/CoreValidation/Project/build.py +++ b/CMSIS/CoreValidation/Project/build.py @@ -253,11 +253,6 @@ def model_exec(config): return cmdline -# @matrix_filter -# def filter_iar(config): -# return config.compiler == CompilerAxis.IAR - - @matrix_filter def filter_gcc_cm85(config): return config.compiler == CompilerAxis.GCC and config.device.match('CM85*')