Skip to content

Commit ee5ea5f

Browse files
committed
Add GitHub workflow for CoreValidation
1 parent bb1b2b9 commit ee5ea5f

3 files changed

Lines changed: 144 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish CoreValidation Results
2+
3+
on:
4+
workflow_run:
5+
workflows: ["corevalidation"]
6+
# avoid running once merged on main branch, this should be run only on PRs
7+
branches-ignore: ["main"]
8+
types:
9+
- completed
10+
11+
jobs:
12+
publish-test-results:
13+
name: Publish Test Results
14+
runs-on: ubuntu-22.04
15+
if: github.event.workflow_run.conclusion != 'skipped'
16+
17+
steps:
18+
- name: Download and Extract Artifacts
19+
env:
20+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
21+
run: |
22+
mkdir -p artifacts && cd artifacts
23+
24+
artifacts_url=${{ github.event.workflow_run.artifacts_url }}
25+
26+
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
27+
do
28+
IFS=$'\t' read name url <<< "$artifact"
29+
gh api $url > "$name.zip"
30+
unzip -d "$name" "$name.zip"
31+
done
32+
33+
- name: Publish Test Results
34+
uses: EnricoMi/publish-unit-test-result-action@v2
35+
with:
36+
commit: ${{ github.event.workflow_run.head_sha }}
37+
event_file: artifacts/EventFile/event.json
38+
report_individual_runs: true
39+
event_name: ${{ github.event.workflow_run.event }}
40+
files: "artifacts/**/*.xml"
41+
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Build CoreValidation tests
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
corevalidation:
15+
name: Build
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- working-directory: /home/runner
21+
env:
22+
GH_TOKEN: ${{ github.token }}
23+
run: |
24+
if [ -d CMSIS-DFP ]; then
25+
cd CMSIS-DFP
26+
git fetch origin main
27+
git checkout -f origin/main
28+
else
29+
gh repo clone ARM-software/CMSIS-DFP
30+
fi
31+
32+
- uses: actions/setup-python@v4
33+
with:
34+
python-version: '3.10'
35+
cache: 'pip'
36+
37+
- name: Cache vcpkg
38+
uses: actions/cache@v3
39+
with:
40+
key: vcpkg
41+
path: /home/runner/.vcpkg
42+
43+
- name: Cache Arm Compiler 6
44+
uses: actions/cache@v3
45+
with:
46+
key: armcompiler-6.20.0
47+
path: /home/runner/standalone-linux-x86_64-rel.tgz
48+
49+
- name: Install Arm Compiler 6
50+
working-directory: /home/runner
51+
run: |
52+
test -f standalone-linux-x86_64-rel.tgz || \
53+
wget https://artifacts.keil.arm.com/arm-compiler/6.20/21/standalone-linux-x86_64-rel.tgz
54+
mkdir -p arm-compiler-6.20.0
55+
tar xf standalone-linux-x86_64-rel.tgz -C arm-compiler-6.20.0
56+
echo "AC6_TOOLCHAIN_6_20_0=$(pwd)/arm-compiler-6.20.0/bin" >> $GITHUB_ENV
57+
58+
- name: Initialize CodeQL
59+
uses: github/codeql-action/init@v2
60+
with:
61+
languages: cpp
62+
queries: security-and-quality
63+
64+
- name: Execute build
65+
working-directory: ./CMSIS/CoreValidation/Project
66+
run: |
67+
echo "Install Python requirements"
68+
pip install -r requirements.txt
69+
70+
echo "Activate vcpkg environment"
71+
. <(curl https://aka.ms/vcpkg-init.sh -L)
72+
vcpkg activate
73+
74+
echo "Register local CMSIS-DFP pack"
75+
cpackget add /home/runner/CMSIS-DFP/ARM.CMSIS_DFP.pdsc
76+
77+
echo "Run build script"
78+
./build.py --verbose -m FVP -c GCC -c AC6 build || echo "=== Something failed! ==="
79+
80+
- name: Perform CodeQL Analysis
81+
if: always()
82+
uses: github/codeql-action/analyze@v2
83+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"registries": [
3+
{
4+
"kind": "artifact",
5+
"location": "https://aka.ms/vcpkg-ce-default",
6+
"name": "microsoft"
7+
},
8+
{
9+
"kind": "artifact",
10+
"location": "https://artifacts.keil.arm.com/vcpkg-ce-registry/registry.zip",
11+
"name": "arm"
12+
}
13+
],
14+
"requires": {
15+
"microsoft:ninja": "^1.10.2",
16+
"arm:compilers/arm/arm-none-eabi-gcc": "^12.2.1-0",
17+
"arm:tools/open-cmsis-pack/cmsis-toolbox": "^2.0.0-0"
18+
}
19+
}
20+

0 commit comments

Comments
 (0)