Update RV2 to use Clang 17 #164
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: RTOS2 Validation | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
ARM_UBL_ACTIVATION_CODE: ${{ secrets.ARM_UBL_ACTIVATION_CODE }} | |
jobs: | |
build-and-run: | |
strategy: | |
fail-fast: true | |
matrix: | |
compiler: [AC6, GCC, Clang] | |
rtos: [RTX5, FreeRTOS] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- working-directory: /home/runner | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
if [ -d CMSIS_6 ]; then | |
cd CMSIS_6 | |
git fetch origin main | |
git checkout -f origin/main | |
else | |
gh repo clone ARM-software/CMSIS_6 | |
fi | |
- working-directory: /home/runner | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
if [ -d CMSIS-RTX ]; then | |
cd CMSIS-RTX | |
git fetch origin main | |
git checkout -f origin/main | |
else | |
gh repo clone ARM-software/CMSIS-RTX | |
fi | |
- working-directory: /home/runner | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
if [ -d CMSIS-FreeRTOS ]; then | |
cd CMSIS-FreeRTOS | |
git fetch origin main | |
git checkout -f origin/main | |
else | |
gh repo clone ARM-software/CMSIS-FreeRTOS | |
fi | |
- working-directory: /home/runner | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
if [ -d Cortex_DFP ]; then | |
cd Cortex_DFP | |
git fetch origin main | |
git checkout -f origin/main | |
else | |
gh repo clone ARM-software/Cortex_DFP | |
fi | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
- name: Install system packages | |
run: | | |
sudo add-apt-repository ppa:deadsnakes/ppa | |
sudo apt-get install libpython3.9 libtinfo5 | |
- name: Python requirements | |
run: | | |
pip install -r ./Project/requirements.txt | |
- name: Cache packs | |
uses: actions/cache@v3 | |
with: | |
key: packs-${{ github.run_id }}-${{ matrix.compiler }}-${{ matrix.rtos }} | |
restore-keys: | | |
packs- | |
path: /home/runner/.cache/arm/packs | |
- name: Cache vcpkg | |
uses: actions/cache@v3 | |
with: | |
key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ matrix.compiler }}-${{ matrix.rtos }} | |
restore-keys: | | |
vcpkg-${{ runner.os }}-${{ runner.arch }}- | |
path: /home/runner/.vcpkg | |
- name: Prepare vcpkg env | |
working-directory: ./Project | |
run: | | |
. <(curl https://aka.ms/vcpkg-init.sh -L) | |
vcpkg x-update-registry --all | |
vcpkg activate | |
echo "Patch CMSIS-Toolbox" | |
pushd $(dirname $(which cbuild))/../etc | |
curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/buildmgr/cbuildgen/config/CLANG.17.0.1.cmake | |
popd | |
- name: Activate Arm tool license | |
working-directory: ./Project | |
run: | | |
. /home/runner/.vcpkg/vcpkg-init | |
vcpkg activate | |
if [[ -n "${{ env.ARM_UBL_ACTIVATION_CODE }}" ]]; then | |
armlm activate --code ${{ env.ARM_UBL_ACTIVATION_CODE }} | |
else | |
armlm activate --server https://mdk-preview.keil.arm.com --product KEMDK-COM0 | |
fi | |
- uses: ammaraskar/gcc-problem-matcher@master | |
if: matrix.compiler == 'GCC' | |
- name: Initialize CodeQL | |
if: matrix.compiler == 'GCC' | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: c-cpp | |
queries: security-and-quality | |
- name: Build | |
working-directory: ./Project | |
run: | | |
. /home/runner/.vcpkg/vcpkg-init | |
vcpkg activate | |
echo "Register local packs" | |
cpackget rm ARM::CMSIS ARM::CMSIS-RTX ARM::CMSIS-FreeRTOS || echo "Ok" | |
cpackget add /home/runner/CMSIS_6/ARM.CMSIS.pdsc | |
cpackget add /home/runner/CMSIS-RTX/ARM.CMSIS-RTX.pdsc | |
cpackget add /home/runner/CMSIS-FreeRTOS/ARM.CMSIS-FreeRTOS.pdsc | |
cpackget add /home/runner/Cortex_DFP/ARM.Cortex_DFP.pdsc | |
echo "Build test projects ..." | |
./build.py --verbose -r ${{ matrix.rtos }} -c ${{ matrix.compiler }} build || echo "::warning::=== Some configurations failed to build! ===" | |
- name: Execute | |
if: ${{ env.ARM_UBL_ACTIVATION_CODE }} | |
working-directory: ./Project | |
run: | | |
. /home/runner/.vcpkg/vcpkg-init | |
vcpkg activate | |
echo "Run test projects ..." | |
./build.py --verbose -r ${{ matrix.rtos }} -c ${{ matrix.compiler }} run || echo "::warning::==== Some configurations failed to run! ===" | |
- name: Deactivate Arm tool license | |
if: always() | |
working-directory: ./Project | |
run: | | |
. /home/runner/.vcpkg/vcpkg-init | |
vcpkg activate | |
if [[ -n "${{ env.ARM_UBL_ACTIVATION_CODE }}" ]]; then | |
armlm deactivate --code ${{ env.ARM_UBL_ACTIVATION_CODE }} | |
else | |
armlm deactivate --product KEMDK-COM0 | |
fi | |
- name: Perform CodeQL Analysis | |
if: matrix.compiler == 'GCC' | |
uses: github/codeql-action/analyze@v2 | |
- name: Upload Test Reports | |
if: ${{ !cancelled() && env.ARM_UBL_ACTIVATION_CODE }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-results-${{ matrix.rtos }}-${{ matrix.compiler }} | |
path: Project/*.junit | |
publish-test-results: | |
needs: [build-and-run] | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'pull_request' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Download Test Reports | |
if: ${{ env.ARM_UBL_ACTIVATION_CODE }} | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: Publish Test Results | |
if: ${{ env.ARM_UBL_ACTIVATION_CODE && env.GITHUB_TOKEN }} | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
commit: ${{ github.event.workflow_run.head_sha }} | |
event_file: ${{ github.event_path }} | |
report_individual_runs: true | |
event_name: ${{ github.event.workflow_run.event }} | |
files: "artifacts/**/*.junit" | |