Skip to content

Commit

Permalink
Add GitHub workflow for CoreValidation
Browse files Browse the repository at this point in the history
  • Loading branch information
JonatanAntoni committed Jul 4, 2023
1 parent bb1b2b9 commit 56488cb
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/corevalidation-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish CoreValidation Results

on:
workflow_run:
workflows: ["corevalidation"]
# avoid running once merged on main branch, this should be run only on PRs
branches-ignore: ["main"]
types:
- completed

jobs:
publish-test-results:
name: Publish Test Results
runs-on: ubuntu-22.04
if: github.event.workflow_run.conclusion != 'skipped'

steps:
- name: Download and Extract Artifacts
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
mkdir -p artifacts && cd artifacts
artifacts_url=${{ github.event.workflow_run.artifacts_url }}
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
do
IFS=$'\t' read name url <<< "$artifact"
gh api $url > "$name.zip"
unzip -d "$name" "$name.zip"
done
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/EventFile/event.json
report_individual_runs: true
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.xml"

86 changes: 86 additions & 0 deletions .github/workflows/corevalidation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Build CoreValidation tests
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
corevalidation:
name: Build
runs-on: ubuntu-latest
steps:
- 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: Cache vcpkg
uses: actions/cache@v3
with:
key: vcpkg
path: /home/runner/.vcpkg

- name: Cache Arm Compiler 6
uses: actions/cache@v3
with:
key: armcompiler-6.20.0
path: /home/runner/standalone-linux-x86_64-rel.tgz

- name: Install Arm Compiler 6
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: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
queries: security-and-quality

- name: Execute build
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 activate
echo "Activate Arm tool license"
${AC6_TOOLCHAIN_6_20_0}/armlm activate --server https://mdk-preview.keil.arm.com --product KEMDK-COM0
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 GCC -c AC6 build || echo "=== Something failed! ==="
- name: Perform CodeQL Analysis
if: always()
uses: github/codeql-action/analyze@v2

20 changes: 20 additions & 0 deletions CMSIS/CoreValidation/Project/vcpkg-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"registries": [
{
"kind": "artifact",
"location": "https://aka.ms/vcpkg-ce-default",
"name": "microsoft"
},
{
"kind": "artifact",
"location": "https://artifacts.keil.arm.com/vcpkg-ce-registry/registry.zip",
"name": "arm"
}
],
"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"
}
}

0 comments on commit 56488cb

Please sign in to comment.