name: CoreValidation on: workflow_dispatch: pull_request: branches: [main] push: branches: [main] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build-and-run: strategy: fail-fast: true matrix: compiler: [AC6, GCC, Clang] runs-on: ubuntu-latest steps: - run: | sudo add-apt-repository ppa:deadsnakes/ppa sudo apt-get install libpython3.9 - uses: actions/checkout@v3 - working-directory: /home/runner env: GH_TOKEN: ${{ github.token }} run: | if [ -d CMSIS-DFP ]; then cd CMSIS-DFP git fetch origin main git checkout -f origin/main else gh repo clone ARM-software/CMSIS-DFP fi - uses: actions/setup-python@v4 with: python-version: '3.10' cache: 'pip' - name: Python requirements run: | pip install -r ./CMSIS/CoreValidation/Project/requirements.txt - name: Cache vcpkg uses: actions/cache@v3 with: key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ matrix.compiler }} restore-keys: | vcpkg-${{ runner.os }}-${{ runner.arch }}- path: /home/runner/.vcpkg - name: Cache LLVM/Clang 17.0.0-devdrop0 if: matrix.compiler == 'Clang' uses: actions/cache@v3 with: key: clang-17.0.0-devdrop0-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ matrix.compiler }} restore-keys: | clang-17.0.0-devdrop0-${{ runner.os }}-${{ runner.arch }}- clang-17.0.0-devdrop0 path: /home/runner/LLVMEmbeddedToolchainForArm-17.0.0-Linux-x86_64 - name: Install LLVM/Clang 17.0.0-devdrop0 if: matrix.compiler == 'Clang' working-directory: /home/runner run: | sudo apt-get update sudo apt-get install libtinfo5 if [[ ! -d LLVMEmbeddedToolchainForArm-17.0.0-Linux-x86_64 ]]; then wget https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/preview-17.0.0-devdrop0/LLVMEmbeddedToolchainForArm-17.0.0-Linux-x86_64.tar.xz tar -xf LLVMEmbeddedToolchainForArm-17.0.0-Linux-x86_64.tar.xz fi ./LLVMEmbeddedToolchainForArm-17.0.0-Linux-x86_64/bin/clang --version echo "CLANG_TOOLCHAIN_17_0_0=$(pwd)/LLVMEmbeddedToolchainForArm-17.0.0-Linux-x86_64/bin" >> $GITHUB_ENV - name: Prepare vcpkg env working-directory: ./CMSIS/CoreValidation/Project run: | . <(curl https://aka.ms/vcpkg-init.sh -L) vcpkg x-update-registry --all vcpkg activate echo "Fix library search path for VHT models" echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(dirname $(which VHT_MPS2_Cortex-M3))" >> $GITHUB_ENV echo "Fix execute permissions for VHT models" chmod +x $(dirname $(which VHT_MPS2_Cortex-M3))/VHT_* echo "Patch CMSIS-Toolbox" pushd $(dirname $(which cbuild))/../etc curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/buildmgr/cbuildgen/config/AC6.6.18.0.cmake curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/buildmgr/cbuildgen/config/GCC.10.3.1.cmake curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/buildmgr/cbuildgen/config/CLANG.16.0.0.cmake curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/buildmgr/cbuildgen/config/IAR.9.32.1.cmake curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/buildmgr/cbuildgen/config/CMSIS-Build-Utils.cmake curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/templates/cdefault.yml curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/templates/ac6_linker_script.sct curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/templates/clang_linker_script.ld curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/templates/gcc_linker_script.ld curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/templates/iar_linker_script.ifc popd - name: Activate Arm tool license working-directory: ./CMSIS/CoreValidation/Project run: | . /home/runner/.vcpkg/vcpkg-init vcpkg activate armlm activate --code ${{ secrets.ARM_UBL_ACTIVATION_CODE }} - name: Initialize CodeQL if: matrix.compiler == 'GCC' uses: github/codeql-action/init@v2 with: languages: cpp queries: security-and-quality - uses: ammaraskar/gcc-problem-matcher@master if: matrix.compiler == 'Clang' || matrix.compiler == 'GCC' - name: Build working-directory: ./CMSIS/CoreValidation/Project run: | . /home/runner/.vcpkg/vcpkg-init vcpkg activate echo "Register local CMSIS-DFP pack" cpackget add /home/runner/CMSIS-DFP/ARM.CMSIS_DFP.pdsc echo "Build test projects ..." ./build.py --verbose -m VHT -c ${{ matrix.compiler }} build || echo "=== Something failed! ===" - name: Perform CodeQL Analysis if: ${{ !cancelled() && matrix.compiler == 'GCC' }} uses: github/codeql-action/analyze@v2 - name: Execute working-directory: ./CMSIS/CoreValidation/Project run: | . /home/runner/.vcpkg/vcpkg-init vcpkg activate echo "Run test projects ..." ./build.py --verbose -m VHT -c ${{ matrix.compiler }} -d "CM[047]*" -d "CM3" -d "CM[23]3*" run || echo "=== Something failed! ===" - name: Deactivate Arm tool license if: always() working-directory: ./CMSIS/CoreValidation/Project run: | . /home/runner/.vcpkg/vcpkg-init vcpkg activate armlm deactivate --product HWSKT-EAC0 - name: Archive Test Reports if: ${{ !cancelled() }} uses: actions/upload-artifact@v3 with: name: test-results-${{ matrix.compiler }} path: ./CMSIS/CoreValidation/Project/build/*.junit event-file: needs: [build-and-run] runs-on: ubuntu-latest steps: - name: Archive event file if: ${{ !cancelled() }} uses: actions/upload-artifact@v3 with: name: EventFile path: ${{ github.event_path }}