Skip to content

Commit e5dc191

Browse files
grasci-armMartin Günther
and
Martin Günther
authored
Migrate CMSIS-CoreValidation to CMSIS-Toolbox build system
Co-authored-by: Martin Günther <[email protected]>
1 parent dde5bac commit e5dc191

File tree

241 files changed

+27171
-4681
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+27171
-4681
lines changed

.github/workflows/codeql-analysis.yml

+52-8
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,72 @@ jobs:
2121
analyze:
2222
name: Analyze
2323
runs-on: ubuntu-latest
24-
container:
25-
image: ghcr.io/jonatanantoni/cmsis/linux.gnu:latest
2624
permissions:
2725
actions: read
2826
contents: read
2927
security-events: write
28+
env:
29+
CMSIS_PACK_ROOT: /tmp/.packs-${{ github.run_id }}
3030

3131
steps:
3232
- name: Checkout repository
33-
uses: actions/checkout@v2
33+
uses: actions/checkout@v3
34+
35+
- name: Install build dependencies
36+
run: |
37+
sudo apt install gcc-arm-none-eabi ninja-build cmake
38+
39+
- name: Cache pack folder
40+
id: cache-packs
41+
uses: actions/cache@v3
42+
with:
43+
key: packs-${{ github.run_id }}
44+
restore-keys: |
45+
packs-
46+
path: /tmp/.packs-${{ github.run_id }}
47+
48+
- name: Install CMSIS-Toolbox
49+
run: |
50+
wget https://github.com/Open-CMSIS-Pack/cmsis-toolbox/releases/download/1.1.0/cmsis-toolbox.sh
51+
chmod +x cmsis-toolbox.sh
52+
sudo ./cmsis-toolbox.sh <<EOI
53+
/opt/ctools
54+
$CMSIS_PACK_ROOT
55+
56+
57+
$(dirname $(which arm-none-eabi-gcc 2>/dev/null))
58+
59+
EOI
60+
echo "/opt/ctools/bin" >> $GITHUB_PATH
61+
echo "cpackget : $(which cpackget)"
62+
echo "csolution: $(which csolution)"
63+
echo "cbuild : $(which cbuild)"
64+
65+
- name: Initialize packs folder
66+
if: steps.cache-packs.outputs.cache-hit != 'true'
67+
run: cpackget init https://www.keil.com/pack/index.pidx
68+
69+
- name: Update pack index
70+
if: steps.cache-packs.outputs.cache-hit == 'true'
71+
run: cpackget update-index
72+
73+
- name: Install build.py requirements
74+
run: pip install -r requirements.txt
75+
working-directory: CMSIS/CoreValidation/Project
3476

3577
# Initializes the CodeQL tools for scanning.
3678
- name: Initialize CodeQL
3779
uses: github/codeql-action/init@v2
3880
with:
3981
languages: cpp
4082
queries: security-and-quality
41-
42-
- run: |
43-
ln -s /root/.rtebuild /github/home/.rtebuild
44-
cd CMSIS/CoreValidation/Tests
45-
python3 build.py -c GCC -o low build
83+
84+
- name: Build projects
85+
working-directory: CMSIS/CoreValidation/Project
86+
run: |
87+
pip install -r requirements.txt
88+
cpackget add -a -f cpacklist.txt
89+
python build.py --verbose -c GCC -d "CM[047]*" -d "CM[23]3*" -o low build || echo "Something failed!"
4690
4791
- name: Perform CodeQL Analysis
4892
uses: github/codeql-action/analyze@v2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish CoreValidation Test Results
2+
3+
on:
4+
workflow_run:
5+
workflows: ["CoreValidation"]
6+
branches-ignore: ["develop"]
7+
types:
8+
- completed
9+
10+
jobs:
11+
publish-test-results:
12+
name: Publish CoreValidation Test Results
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
issues: read
17+
checks: write
18+
pull-requests: write
19+
if: |
20+
github.event.workflow_run.event == "pull_request" &&
21+
github.event.workflow_run.conclusion != 'skipped'
22+
23+
steps:
24+
- name: Download test results
25+
env:
26+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
27+
run: |
28+
mkdir -p artifacts && cd artifacts
29+
30+
artifacts_url=${{ github.event.workflow_run.artifacts_url }}
31+
32+
gh api "$artifacts_url" -q '.artifacts[] | select(.name=="tests") | [.name, .archive_download_url] | @tsv' | while read artifact
33+
do
34+
IFS=$'\t' read name url <<< "$artifact"
35+
gh api $url > "$name.zip"
36+
unzip -d "$name" "$name.zip"
37+
done
38+
39+
- name: Publish Test Results
40+
uses: EnricoMi/publish-unit-test-result-action@v2
41+
with:
42+
commit: ${{ github.event.workflow_run.head_sha }}
43+
event_file: artifacts/Event File/event.json
44+
report_individual_runs: true
45+
event_name: ${{ github.event.workflow_run.event }}
46+
junit_files: "artifacts/**/*.junit"

.github/workflows/corevalidation.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# The repository needs to provide the following secrets
2+
# - AWS_DEFAULT_REGION The data center region to be used.
3+
# - AWS_S3_BUCKET_NAME The name of the S3 storage bucket to be used for data exchange.
4+
# - AWS_IAM_PROFILE The IAM profile to be used.
5+
# - AWS_ASSUME_ROLE The AWS access role to be assumed.
6+
# - AWS_SECURITY_GROUP_ID The id of the security group to add the EC2 instance to.
7+
# - AWS_SUBNET_ID The id of the network subnet to connect the EC2 instance to.
8+
9+
name: CoreValidation
10+
on:
11+
push:
12+
branches: [ main ]
13+
pull_request:
14+
paths:
15+
- .github/workflows/corevalidation.yml
16+
- CMSIS/Core/**/*
17+
- CMSIS/Core_A/**/*
18+
- CMSIS/CoreValidation/**/*
19+
- Device/ARM/**/*
20+
workflow_dispatch:
21+
22+
env:
23+
AWS_S3_BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME }}
24+
AWS_IAM_PROFILE: ${{ secrets.AWS_IAM_PROFILE }}
25+
AWS_SECURITY_GROUP_ID: ${{ secrets.AWS_SECURITY_GROUP_ID }}
26+
AWS_SUBNET_ID: ${{ secrets.AWS_SUBNET_ID }}
27+
jobs:
28+
ci_test:
29+
runs-on: ubuntu-latest
30+
permissions:
31+
id-token: write
32+
contents: read
33+
outputs:
34+
avhresult: ${{ steps.avh.conclusion }}
35+
testbadge: ${{ steps.avh.outputs.badge }}
36+
steps:
37+
- name: Check out repository code
38+
uses: actions/checkout@v3
39+
40+
- name: Set up Python 3.10
41+
uses: actions/setup-python@v2
42+
with:
43+
python-version: '3.10'
44+
45+
- name: Install AVH Client for Python
46+
run: |
47+
pip install git+https://github.com/ARM-software/[email protected]
48+
49+
- uses: ammaraskar/gcc-problem-matcher@master
50+
51+
- name: Configure AWS Credentials
52+
uses: aws-actions/configure-aws-credentials@v1
53+
with:
54+
role-to-assume: ${{ secrets.AWS_ASSUME_ROLE }}
55+
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
56+
57+
- name: Run tests
58+
id: avh
59+
run: |
60+
avhclient -b aws execute --specfile CMSIS/CoreValidation/Project/avh.yml
61+
62+
- name: Archive build results
63+
uses: actions/upload-artifact@v2
64+
with:
65+
name: builds
66+
path: CMSIS/CoreValidation/Project/Core_Validation-*.zip
67+
retention-days: 1
68+
if-no-files-found: error
69+
if: always()
70+
71+
- name: Archive test results
72+
uses: actions/upload-artifact@v2
73+
with:
74+
name: tests
75+
path: CMSIS/CoreValidation/Project/Core_Validation-*.junit
76+
retention-days: 1
77+
if-no-files-found: error
78+
if: always()

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
Local_Release/
55
CMSIS/Documentation/
66
CMSIS/RTOS2/RTX/Library/ARM/MDK/RTX_CM.uvguix.*
7-
CMSIS/CoreValidation/Tests/build
8-
CMSIS/CoreValidation/Tests/bootloader/build
7+
CMSIS/CoreValidation/Project/*.zip
8+
CMSIS/CoreValidation/Project/*.junit
9+
CMSIS/CoreValidation/Project/Validation.*/
10+
CMSIS/CoreValidation/Project/Bootloader.*/
911
*.uvguix.*
1012
*.uvmpw.uvgui.*
1113
*.zip

0 commit comments

Comments
 (0)