0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 14:48:03 +03:00

Initial commit

This commit is contained in:
OneOfEleven
2023-09-09 08:03:56 +01:00
parent 92305117f1
commit 54441e27d9
3388 changed files with 582553 additions and 0 deletions

View File

@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "fileheader",
"severity": "error",
"pattern": [
{
"regexp": "^(.*):(\\d+):(.*)$",
"file": 1,
"line": 2,
"message": 3
}
]
}
]
}

View File

@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "fileheader",
"severity": "error",
"pattern": [
{
"regexp": "^(.*):(\\d+);(.*);(.*)$",
"file": 1,
"line": 2,
"message": 4
}
]
}
]
}

View File

@ -0,0 +1,27 @@
name: Caller CoreValidation
on:
push:
branches: [ main ]
pull_request:
paths:
- .github/workflows/caller-corevalidation.yml
- CMSIS/Core/**/*
- CMSIS/Core_A/**/*
- CMSIS/CoreValidation/**/*
- Device/ARM/**/*
workflow_dispatch:
jobs:
upload_pr_number:
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
mkdir -p ./pr
echo -n $PR_NUMBER > ./pr/pr_number
- uses: actions/upload-artifact@v3
with:
name: pr_number
path: pr/

View File

@ -0,0 +1,92 @@
name: "CodeQL"
on:
workflow_dispatch:
push:
branches: [ develop ]
paths:
- 'CMSIS/Core/**'
- 'CMSIS/Core_A/**'
- 'CMSIS/CoreValidation/**'
- 'Device/ARM/**'
pull_request:
branches: [ develop ]
paths:
- '.github/workflows/codeql-analysis.yml'
- 'CMSIS/Core/**'
- 'CMSIS/Core_A/**'
- 'CMSIS/CoreValidation/**'
- 'Device/ARM/**'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
env:
CMSIS_PACK_ROOT: /tmp/.packs-${{ github.run_id }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install build dependencies
run: |
sudo apt install gcc-arm-none-eabi ninja-build cmake
- name: Cache pack folder
id: cache-packs
uses: actions/cache@v3
with:
key: packs-${{ github.run_id }}
restore-keys: |
packs-
path: /tmp/.packs-${{ github.run_id }}
- name: Install CMSIS-Toolbox
run: |
wget https://github.com/Open-CMSIS-Pack/cmsis-toolbox/releases/download/1.5.0/cmsis-toolbox.sh
chmod +x cmsis-toolbox.sh
sudo ./cmsis-toolbox.sh <<EOI
/opt/ctools
$CMSIS_PACK_ROOT
$(dirname $(which arm-none-eabi-gcc 2>/dev/null))
EOI
echo "/opt/ctools/bin" >> $GITHUB_PATH
echo "cpackget : $(which cpackget)"
echo "csolution: $(which csolution)"
echo "cbuild : $(which cbuild)"
- name: Initialize packs folder
if: steps.cache-packs.outputs.cache-hit != 'true'
run: cpackget init https://www.keil.com/pack/index.pidx
- name: Update pack index
if: steps.cache-packs.outputs.cache-hit == 'true'
run: cpackget update-index
- name: Install build.py requirements
run: pip install -r requirements.txt
working-directory: CMSIS/CoreValidation/Project
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
queries: security-and-quality
- name: Build projects
working-directory: CMSIS/CoreValidation/Project
run: |
pip install -r requirements.txt
cpackget add -a -f cpacklist.txt
python build.py --verbose -c GCC -d "CM[047]*" -d "CM[23]3*" -o low build || echo "Something failed!"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

View File

@ -0,0 +1,44 @@
name: Publish CoreValidation Test Results
on:
workflow_run:
workflows: ["CoreValidation"]
branches-ignore: ["develop"]
types:
- completed
jobs:
publish-test-results:
name: Publish CoreValidation Test Results
runs-on: ubuntu-latest
permissions:
contents: read
issues: read
checks: write
pull-requests: write
if: github.event.workflow_run.conclusion != 'skipped'
steps:
- name: Download test results
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[] | select(.name=="tests" or .name=="EventFile") | [.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 }}
junit_files: "artifacts/**/*.junit"

View File

@ -0,0 +1,161 @@
# This workflow is triggered whenever "Caller CoreValidation" workflow is completed (which is called by PR).
# This workflow ideally should be triggered also by PR, but forked PR has limited permissions which does not
# allow to use `configure-aws-credentials` actions and using secrets.
# It will update its status back to the caller PR as "CoreValidation" check name
name: CoreValidation
on:
workflow_run:
workflows:
- Caller CoreValidation
types:
- completed
# The env variables relate to an ARM AWS account for CMSIS_5
# If you are forking CMSIS_5 repo, please use your own info.
env:
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_IAM_PROFILE: ${{ secrets.AWS_IAM_PROFILE }}
AWS_S3_BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME }}
AWS_SECURITY_GROUP_ID: ${{ secrets.AWS_SECURITY_GROUP_ID }}
AWS_SUBNET_ID: ${{ secrets.AWS_SUBNET_ID }}
jobs:
set_pending_status_to_pr:
runs-on: ubuntu-latest
steps:
- name: Set a pending status to the PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_commit.id }} \
--header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
--header 'content-type: application/json' \
--data '{
"state": "pending",
"context": "CoreValidation",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}' \
--fail
ci_test:
runs-on: ubuntu-latest
needs: set_pending_status_to_pr
permissions:
id-token: write
contents: read
outputs:
avhresult: ${{ steps.avh.conclusion }}
testbadge: ${{ steps.avh.outputs.badge }}
steps:
- name: Download workflow artifact
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: caller-corevalidation.yml
run_id: ${{ github.event.workflow_run.id }}
- name: Read the pr_num file
id: pr_num_reader
uses: juliangruber/read-file-action@v1.1.6
with:
path: ./pr_number/pr_number
trim: true
- name: Clone this repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout PR
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
gh pr checkout ${{ steps.pr_num_reader.outputs.content }}
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install AVH Client for Python
run: |
pip install git+https://github.com/ARM-software/avhclient.git@v0.1
- uses: ammaraskar/gcc-problem-matcher@master
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Run tests
id: avh
run: |
avhclient -b aws execute --specfile CMSIS/CoreValidation/Project/avh.yml
- name: Archive build results
uses: actions/upload-artifact@v3
with:
name: builds
path: CMSIS/CoreValidation/Project/Core_Validation-*.zip
retention-days: 1
if-no-files-found: error
if: always()
- name: Archive test results
uses: actions/upload-artifact@v3
with:
name: tests
path: CMSIS/CoreValidation/Project/Core_Validation-*.junit
retention-days: 1
if-no-files-found: error
if: always()
- name: Archive event file
uses: actions/upload-artifact@v3
with:
name: EventFile
path: ${{ github.event_path }}
set_success_status_to_pr:
runs-on: ubuntu-latest
needs: ci_test
if: ${{ success() }}
steps:
- name: Set success status to the PR
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_commit.id }} \
--header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
--header 'content-type: application/json' \
--data '{
"state": "success",
"context": "CoreValidation",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}' \
--fail
set_failure_status_to_pr:
runs-on: ubuntu-latest
needs: ci_test
if: ${{ failure() }}
steps:
- name: Set failure status to the PR
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_commit.id }} \
--header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
--header 'content-type: application/json' \
--data '{
"state": "failure",
"context": "CoreValidation",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}' \
--fail

View File

@ -0,0 +1,42 @@
name: File header
on:
pull_request:
branches: [ develop ]
paths:
- 'CMSIS/Core/**'
- 'CMSIS/Core_A/**'
- 'CMSIS/RTOS2/Include/**'
- 'CMSIS/RTOS2/Source/**'
- 'Device/**'
permissions:
contents: read
pull-requests: write
jobs:
check:
name: Check file header
runs-on: ubuntu-latest
steps:
- name: Calculate depth
id: depth
run: |
echo ::set-output name=GIT_COMMITS::$((${{ github.event.pull_request.commits }} + 1))
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: ${{ steps.depth.outputs.GIT_COMMITS }}
- id: files
uses: jitterbit/get-changed-files@v1
- name: Check changed files
run: |
echo "GIT_COMMITS=${{ steps.depth.outputs.GIT_COMMITS }}"
echo "::add-matcher::.github/fileheader.json"
RC=0
for changed_file in ${{ steps.files.outputs.added_modified }}; do
./CMSIS/Utilities/check_header.sh -v -b HEAD~${{ github.event.pull_request.commits }} ${changed_file} || RC=1
done
echo "::remove-matcher owner=fileheader::"
exit $RC

View File

@ -0,0 +1,65 @@
name: Publish Documentation
on:
workflow_dispatch:
pull_request:
branches: [ develop ]
paths:
- '.github/workflows/gh-pages.yaml'
- 'CMSIS/Utilities/check_links.sh'
- 'CMSIS/DoxyGen/**'
push:
branches: [ develop ]
paths:
- '.github/workflows/gh-pages.yaml'
- 'CMSIS/Utilities/check_links.sh'
- 'CMSIS/DoxyGen/**'
jobs:
docs:
name: Build develop documentation
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Install Doxygen 1.8.6
run: |
wget http://archive.ubuntu.com/ubuntu/pool/main/d/doxygen/doxygen_1.8.6-2_amd64.deb
sudo dpkg -i doxygen_1.8.6-2_amd64.deb
- name: Install mscgen 0.20
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y mscgen=0.20-12
- name: Install linkchecker
run: |
sudo pip install LinkChecker
- name: Generate doxygen
run: CMSIS/DoxyGen/gen_doc.sh
- name: Run linkchecker
run: |
echo "::add-matcher::.github/linkchecker.json"
CMSIS/Utilities/check_links.sh CMSIS/Documentation/index.html
- name: Upload documentation
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v2
with:
path: CMSIS/Documentation/**
- name: Archive documentation
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
run: |
cd CMSIS/Documentation
tar -cvjf /tmp/doc.tbz2 .
- uses: actions/checkout@v2
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
with:
ref: gh-pages
- name: Publish documentation
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
run: |
rm -r develop
mkdir develop
cd develop
tar -xvjf /tmp/doc.tbz2
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "Update develop documentation"
git push

View File

@ -0,0 +1,31 @@
name: Pack Description
on:
pull_request:
branches: [ develop ]
paths:
- 'ARM.CMSIS.pdsc'
permissions:
contents: read
pull-requests: write
jobs:
check:
name: Check pack description schema
runs-on: ubuntu-latest
steps:
- name: Install xmllint
run: |
sudo apt-get update
sudo apt-get install libxml2-utils
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run xmllint
run: |
curl https://raw.githubusercontent.com/Open-CMSIS-Pack/Open-CMSIS-Pack-Spec/main/schema/PACK.xsd -o CMSIS/Utilities/PACK.xsd
echo "::add-matcher::.github/xmllint.json"
xmllint --noout --schema "$(realpath -m ./CMSIS/Utilities/PACK.xsd)" "ARM.CMSIS.pdsc"
echo "::remove-matcher owner=xmllint::"

View File

@ -0,0 +1,41 @@
name: Release Documentation
on:
release:
types: [published]
jobs:
docs:
name: Build release documentation
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Install Doxygen 1.8.6
run: |
wget http://archive.ubuntu.com/ubuntu/pool/main/d/doxygen/doxygen_1.8.6-2_amd64.deb
sudo dpkg -i doxygen_1.8.6-2_amd64.deb
- name: Install mscgen 0.20
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y mscgen=0.20-12
- name: Generate doxygen
run: CMSIS/DoxyGen/gen_doc.sh
- name: Archive documentation
run: |
cd CMSIS/Documentation
tar -cvjf /tmp/doc.tbz2 .
- uses: actions/checkout@v2
with:
ref: gh-pages
- name: Publish documentation
run: |
RELEASE=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
mkdir ${RELEASE}
rm latest
ln -s ${RELEASE} latest
cd ${RELEASE}
tar -xvjf /tmp/doc.tbz2
git config user.name github-actions
git config user.email github-actions@github.com
git add . ../latest
git commit -m "Update documentation for release ${RELEASE}"
git push

16
external/CMSIS_5/.github/xmllint.json vendored Normal file
View File

@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "xmllint",
"severity": "error",
"pattern": [
{
"regexp": "^(.*):(\\d+):(.*)$",
"file": 1,
"line": 2,
"message": 3
}
]
}
]
}