Skip to content

Initial nightly check #1

Initial nightly check

Initial nightly check #1

name: Download Nightly Assets
on:
# schedule:
# - cron: '0 0 * * *' # Runs daily at midnight
workflow_dispatch: # Allows manual triggering of the workflow
pull_request:
paths:
- '.github/workflows/nightly.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
create-toolbox:
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-13]
arch: [amd64, arm64]
include:
- os: windows-latest
target: windows
extn: .exe
- os: ubuntu-latest
target: linux
extn:
- os: macos-13
target: darwin
extn:
steps:
- name: Authenticate with GitHub CLI
shell: bash
run: |
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
- name: Get latest nightly Run ID
id: get_run_id
shell: bash
run: |
RUN_ID=$(gh run list --limit 1 --workflow nightly --repo Open-CMSIS-Pack/devtools --json databaseId --jq '.[0].databaseId')
echo "NIGHTLY_RUN_ID=$RUN_ID" >> $GITHUB_OUTPUT
# Download and build cbuild executable
- name: Checkout cbuild repository
uses: actions/checkout@v4
with:
repository: Open-CMSIS-PACK/cbuild
path: cbuild
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: cbuild/go.mod
cache-dependency-path: |
**/go.mod
**/go.sum
- name: Build cbuild executable
working-directory: cbuild
shell: bash
run: |
GOOS=${{ matrix.target }} GOARCH=${{ matrix.arch }} go build -ldflags "-X main.version=$(git describe --tags)" -o build/cbuild${{ matrix.extn }} ./cmd/cbuild
# Download and build cpackget executable
- name: Checkout cpackget repository
uses: actions/checkout@v4
with:
repository: Open-CMSIS-PACK/cpackget
path: cpackget
fetch-depth: 0
- name: Build cpackget executable
working-directory: cpackget
shell: bash
run: |
GOOS=${{ matrix.target }} GOARCH=${{ matrix.arch }} go build -ldflags "-X main.version=$(git describe --tags)" -o build/cpackget${{ matrix.extn }} ./cmd
# Download and build cbuild2cmake executable
- name: Checkout cbuild2cmake repository
uses: actions/checkout@v4
with:
repository: Open-CMSIS-PACK/cbuild2cmake
path: cbuild2cmake
fetch-depth: 0
- name: Build cbuild2cmake executable
working-directory: cbuild2cmake
shell: bash
run: |
GOOS=${{ matrix.target }} GOARCH=${{ matrix.arch }} go build -ldflags "-X main.version=$(git describe --tags)" -o build/cbuild2cmake${{ matrix.extn }} ./cmd/cbuild2cmake
# Download projmgr and cbuildgen from nightly
- name: Download Open-CMSIS-Pack/devtools nightly artifacts
shell: bash
run : |
gh run download -D projmgr-${{ matrix.target }}-${{ matrix.arch }} ${{ steps.get_run_id.outputs.NIGHTLY_RUN_ID }} -n projmgr-${{ matrix.target }}-${{ matrix.arch }} -R Open-CMSIS-Pack/devtools
gh run download -D cbuildgen-${{ matrix.target }}-${{ matrix.arch }} ${{ steps.get_run_id.outputs.NIGHTLY_RUN_ID }} -n cbuildgen-${{ matrix.target }}-${{ matrix.arch }} -R Open-CMSIS-Pack/devtools
- name: Checkout tools repo
uses: actions/checkout@v4
with:
repository: Open-CMSIS-PACK/devtools
path: devtools
- name: Copy Files
shell: bash
run: |
mkdir -p ./cmsis-toolbox/bin
mkdir -p ./cmsis-toolbox/etc
cp ./projmgr-${{ matrix.target }}-${{ matrix.arch }}/csolution${{ matrix.extn }} ./cmsis-toolbox/bin/csolution${{ matrix.extn }}
cp ./cbuildgen-${{ matrix.target }}-${{ matrix.arch }}/cbuildgen${{ matrix.extn }}* ./cmsis-toolbox/bin/cbuildgen${{ matrix.extn }}
cp ./cbuild/build/cbuild${{ matrix.extn }} ./cmsis-toolbox/bin/cbuild${{ matrix.extn }}
cp ./cpackget/build/cpackget${{ matrix.extn }} ./cmsis-toolbox/bin/cpackget${{ matrix.extn }}
cp ./cbuild2cmake/build/cbuild2cmake${{ matrix.extn }} ./cmsis-toolbox/bin/cbuild2cmake${{ matrix.extn }}
cp -r devtools/tools/projmgr/templates/* ./cmsis-toolbox/etc
cp -r devtools/tools/projmgr/schemas/* ./cmsis-toolbox/etc
cp -r devtools/tools/buildmgr/cbuildgen/scripts/* ./cmsis-toolbox/etc
cp -r devtools/tools/buildmgr/cbuildgen/config/* ./cmsis-toolbox/etc
- name: List files
shell: bash
run: |
ls -l ./cmsis-toolbox/bin
ls -l ./cmsis-toolbox/etc
- name: Archieve test results
if: always()
uses: actions/upload-artifact@v4
with:
name: cmsis-toolbox-${{ matrix.target }}-${{ matrix.arch }}
path: cmsis-toolbox
run-tests:
needs: [create-toolbox]
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-13]
arch: [amd64, arm64]
include:
- os: windows-latest
target: windows
- os: ubuntu-latest
target: linux
- os: macos-13
target: darwin
steps:
- name: Checkout toolbox repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install pip dependencies
run: |
pip install --upgrade pip
pip install -r test/requirements.txt
- name: Setup vcpkg environment
uses: ARM-software/cmsis-actions/vcpkg@v1
with:
config: "./test/vcpkg-configuration.json"
vcpkg-downloads: "${{ github.workspace }}/.vcpkg/downloads"
cache: "-"
- name: Activate Arm tool license
run: |
armlm activate --server https://mdk-preview.keil.arm.com --product KEMDK-COM0
working-directory: ./test
- name: Download cmsis toolbox ${{ matrix.target }} ${{ matrix.arch }}
uses: actions/download-artifact@v4
with:
name: cmsis-toolbox-${{ matrix.target }}-${{ matrix.arch }}
path: cmsis-toolbox
- name: Get installed path
if: always()
id: toolbox_path
shell: bash
run: |
echo "set path variable with new path"
echo "$(pwd)/cmsis-toolbox/bin"
echo "path=$(echo "$(pwd)/cmsis-toolbox/bin")" >> $GITHUB_OUTPUT
- name: List files
shell: bash
run: |
ls -l ./cmsis-toolbox/bin
ls -l ./cmsis-toolbox/etc
- name: csolution version
shell: bash
run: |
echo "${{steps.toolbox_path.outputs.path}}"
export PATH="${{steps.toolbox_path.outputs.path}}${PATH:+:${PATH}}"
csolution -V
cpackget -V
cbuild -V
cbuildgen -V
- name: Env check
shell: bash
run: |
export PATH="${{steps.toolbox_path.outputs.path}}${PATH:+:${PATH}}"
env
- name: Run Test
shell: bash
run: |
export PATH="${{steps.toolbox_path.outputs.path}}${PATH:+:${PATH}}"
python -m robot --outputdir reports-${{ matrix.target }}-${{ matrix.arch }} --settag ${{ matrix.target }}-${{ matrix.arch }} --name ${{ matrix.target }}-${{ matrix.arch }} ./test
- name: Archieve test results
if: always()
uses: actions/upload-artifact@v4
with:
name: reports-${{ matrix.target }}-${{ matrix.arch }}
path: reports-${{ matrix.target }}-${{ matrix.arch }}
report:
runs-on: ubuntu-latest
if: always()
needs: run-tests
permissions: write-all
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install pip dependencies
run: |
pip install --upgrade pip
pip install -r test/requirements.txt
- name: Download reports
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: reports-*
- name: Consolidate robot test results
working-directory: artifacts
run: |
python -m robot.rebot --name Collective_Robot_Results --outputdir collective_robot_results --output output.xml \
./reports-windows-amd64/output.xml ./reports-windows-arm64/output.xml \
./reports-linux-amd64/output.xml ./reports-linux-arm64/output.xml \
./reports-darwin-amd64/output.xml ./reports-darwin-arm64/output.xml
- name: Generate Summary report
if: always()
run: |
python ./test/lib/execution_summary.py artifacts/collective_robot_results/output.xml
- name: Print E2E Report
if: always()
run: cat summary_report.md >> $GITHUB_STEP_SUMMARY
- name: Archieve consolidated test results
if: always()
uses: actions/upload-artifact@v4
with:
name: consolidated-reports
path: artifacts/collective_robot_results