Skip to content

Commit

Permalink
Run CoreValidation in VHT models
Browse files Browse the repository at this point in the history
  • Loading branch information
JonatanAntoni authored Aug 9, 2023
1 parent 53ae543 commit dbbfdd6
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/corevalidation-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish CoreValidation Results

on:
workflow_run:
workflows: ["corevalidation"]
workflows: ["CoreValidation"]
# avoid running once merged on main branch, this should be run only on PRs
branches-ignore: ["main"]
types:
Expand Down Expand Up @@ -37,5 +37,5 @@ jobs:
event_file: artifacts/EventFile/event.json
report_individual_runs: true
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.xml"
files: "artifacts/**/*.junit"

125 changes: 94 additions & 31 deletions .github/workflows/corevalidation.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build CoreValidation tests
name: CoreValidation
on:
workflow_dispatch:
pull_request:
Expand All @@ -11,10 +11,17 @@ concurrency:
cancel-in-progress: true

jobs:
corevalidation:
name: Build
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
Expand All @@ -34,37 +41,50 @@ jobs:
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 }}
key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ matrix.compiler }}
restore-keys: |
vcpkg-${{ runner.os }}-${{ runner.arch }}-
vcpkg
path: /home/runner/.vcpkg

- name: Cache Arm Compiler 6
if: matrix.compiler == 'AC6'
uses: actions/cache@v3
with:
key: armcompiler-6.20.0
key: armcompiler-6.20.0-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ matrix.compiler }}
restore-keys: |
armcompiler-6.20.0-${{ runner.os }}-${{ runner.arch }}-
armcompiler-6.20.0
path: /home/runner/standalone-linux-x86_64-rel.tgz

- name: Install Arm Compiler 6
if: matrix.compiler == 'AC6'
working-directory: /home/runner
run: |
test -f standalone-linux-x86_64-rel.tgz || \
wget https://artifacts.keil.arm.com/arm-compiler/6.20/21/standalone-linux-x86_64-rel.tgz
mkdir -p arm-compiler-6.20.0
tar xf standalone-linux-x86_64-rel.tgz -C arm-compiler-6.20.0
echo "AC6_TOOLCHAIN_6_20_0=$(pwd)/arm-compiler-6.20.0/bin" >> $GITHUB_ENV
- name: Cache LLVM/Clang
if: matrix.compiler == 'Clang'
uses: actions/cache@v3
with:
key: clang-17.0.0-devdrop0
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.tar.gz

- name: Install LLVM/Clang
if: matrix.compiler == 'Clang'
working-directory: /home/runner
run: |
sudo apt-get update
Expand All @@ -74,28 +94,17 @@ jobs:
tar -xf LLVMEmbeddedToolchainForArm-17.0.0-Linux-x86_64.tar.xz
./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: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
queries: security-and-quality

- uses: ammaraskar/gcc-problem-matcher@master

- name: Execute build
- name: Prepare vcpkg env
working-directory: ./CMSIS/CoreValidation/Project
run: |
echo "Install Python requirements"
pip install -r requirements.txt
echo "Activate vcpkg environment"
. <(curl https://aka.ms/vcpkg-init.sh -L)
vcpkg x-update-registry --all
vcpkg activate
echo "Activate Arm tool license"
${AC6_TOOLCHAIN_6_20_0}/armlm activate --server https://mdk-preview.keil.arm.com --product KEMDK-COM0
# Fix library search for VHT
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(dirname $(which VHT_MPS2_Cortex-M3))" >> $GITHUB_ENV
chmod +x $(dirname $(which VHT_MPS2_Cortex-M3))/VHT_*
echo "Patch CMSIS-Toolbox"
pushd $(dirname $(which cbuild))/../etc
Expand All @@ -105,16 +114,70 @@ jobs:
curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/templates/clang_linker_script.ld
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 "Run build script"
./build.py --verbose -m FVP -c AC6 -c GCC -c Clang build || echo "=== Something failed! ==="
echo "Deactivate Arm tool license"
${AC6_TOOLCHAIN_6_20_0}/armlm deactivate --product KEMDK-COM0
echo "Build test projects ..."
./build.py --verbose -m VHT -c ${{ matrix.compiler }} build || echo "=== Something failed! ==="
- name: Perform CodeQL Analysis
if: always()
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 }}
4 changes: 2 additions & 2 deletions CMSIS/CoreValidation/Project/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ def bl_output_dir(config):


def model_config(config):
return f"../layer/target/{config.device[1]}/model_config.txt"
return f"../Layer/Target/{config.device[1]}/model_config.txt"


def build_dir(config):
return f"build/{config.device[1]}/{config.compiler}/{config.optimize}"
return f"build/{config.device[1]}/{config.compiler.toolchain}/{config.optimize}"


@matrix_action
Expand Down
3 changes: 2 additions & 1 deletion CMSIS/CoreValidation/Project/vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"requires": {
"microsoft:ninja": "^1.10.2",
"arm:compilers/arm/arm-none-eabi-gcc": "^12.2.1-0",
"arm:tools/open-cmsis-pack/cmsis-toolbox": "^2.0.0-0"
"arm:tools/open-cmsis-pack/cmsis-toolbox": "^2.0.0-0",
"arm:models/arm/avh": "^11.21.15"
}
}

0 comments on commit dbbfdd6

Please sign in to comment.