Initial nightly check #1
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: 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: | |
download-assets: | |
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: Checkout 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: 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 | |
# ---------------------------------------------------------------------- | |
- name: Checkout tools repo | |
uses: actions/checkout@v4 | |
with: | |
repository: Open-CMSIS-PACK/cbuild | |
path: cbuild | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: cbuild/go.mod | |
cache-dependency-path: | | |
**/go.mod | |
**/go.sum | |
- name: Build executables | |
working-directory: cbuild | |
shell: bash | |
run: | | |
go build -o build/cbuild${{ matrix.extn }} ./cmd/cbuild | |
- name: Checkout tools repo | |
uses: actions/checkout@v4 | |
with: | |
repository: Open-CMSIS-PACK/cpackget | |
path: cpackget | |
- name: Build executables | |
working-directory: cpackget | |
shell: bash | |
run: | | |
GOOS=${{ matrix.target }} GOARCH=${{ matrix.arch }} go build -o build/cpackget${{ matrix.extn }} ./cmd | |
- name: Checkout tools repo | |
uses: actions/checkout@v4 | |
with: | |
repository: Open-CMSIS-PACK/devtools | |
path: devtools | |
# ------------------------------------------------------------------------ | |
- 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 | |
# gh run download -D cbuild_install ${{ steps.get_run_id.outputs.NIGHTLY_RUN_ID }} -n cbuild_install -R Open-CMSIS-Pack/devtools | |
- name: Copy Files | |
shell: bash | |
run: | | |
mkdir -p ./cmsis-toolbox-main/bin | |
mkdir -p ./cmsis-toolbox-main/etc | |
cp ./projmgr-${{ matrix.target }}-${{ matrix.arch }}/csolution${{ matrix.extn }} ./cmsis-toolbox-main/bin/csolution${{ matrix.extn }} | |
cp ./cbuildgen-${{ matrix.target }}-${{ matrix.arch }}/cbuildgen${{ matrix.extn }}* ./cmsis-toolbox-main/bin/cbuildgen${{ matrix.extn }} | |
cp ./cbuild/build/cbuild${{ matrix.extn }} ./cmsis-toolbox-main/bin/cbuild${{ matrix.extn }} | |
cp ./cpackget/build/cpackget${{ matrix.extn }} ./cmsis-toolbox-main/bin/cpackget${{ matrix.extn }} | |
cp -r devtools/tools/projmgr/templates/* ./cmsis-toolbox-main/etc | |
cp -r devtools/tools/projmgr/schemas/* ./cmsis-toolbox-main/etc | |
cp -r devtools/tools/buildmgr/cbuildgen/scripts/* ./cmsis-toolbox-main/etc | |
- name: List files | |
shell: bash | |
run: | | |
ls -l ./cmsis-toolbox-main/bin | |
ls -l ./cmsis-toolbox-main/etc | |
- name: Get Patch directory path | |
if: always() | |
id: path | |
run: | | |
echo "set path variable with new path" | |
echo "$(pwd)/cmsis-toolbox-main/bin" | |
echo "path=$(echo $(pwd)/cmsis-toolbox-main/bin)" >> $GITHUB_OUTPUT | |
- name: csolution version before | |
shell: bash | |
run: | | |
export PATH="${{steps.path.outputs.path}}${PATH:+:${PATH}}" | |
csolution -V | |
cpackget -V | |
cbuild -V | |
cbuildgen -V | |
- name: Run Test | |
shell: bash | |
working-directory: ./test | |
run: | | |
export PATH="${{steps.path.outputs.path}}${PATH:+:${PATH}}" | |
python -m robot --outputdir reports-${{ matrix.target }}-${{ matrix.arch }} --settag ${{ matrix.target }}-${{ matrix.arch }} --name ${{ matrix.target }}-${{ matrix.arch }} . | |
- name: Archieve test results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: reports-${{ matrix.target }}-${{ matrix.arch }} | |
path: reports-${{ matrix.target }}-${{ matrix.arch }} | |
# - name: Set up environment variables | |
# run: | | |
# echo "REPO_OWNER=Open-CMSIS-Pack" >> $GITHUB_ENV | |
# echo "REPO_NAME=devtools" >> $GITHUB_ENV | |
# echo "TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
# - name: Get latest release | |
# id: get_latest | |
# run: | | |
# response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
# "https://api.github.com/repos/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}/releases/latest") | |
# tag_name=$(echo "$response" | jq -r .tag_name) | |
# asset_urls=$(echo "$response" | jq -r '.assets[].browser_download_url') | |
# echo "TAG_NAME=$tag_name" >> $GITHUB_ENV | |
# echo "ASSET_URLS=$asset_urls" >> $GITHUB_ENV | |
# - name: Download assets | |
# run: | | |
# mkdir -p nightly_assets | |
# IFS=$'\n' | |
# for url in ${{ env.ASSET_URLS }}; do | |
# curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -o nightly_assets/$(basename $url) $url | |
# done | |
run-tests: | |
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: Checkout 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: Get installed path | |
if: always() | |
id: path | |
run: | | |
echo "set path variable with new path" | |
echo "$(pwd)/cmsis-toolbox-main/bin" | |
echo "path=$(echo $(pwd)/cmsis-toolbox-main/bin)" >> $GITHUB_OUTPUT | |
- name: csolution version before | |
shell: bash | |
run: | | |
export PATH="${{steps.path.outputs.path}}${PATH:+:${PATH}}" | |
csolution -V | |
cpackget -V | |
cbuild -V | |
cbuildgen -V | |
- name: Run Test | |
shell: bash | |
working-directory: ./test | |
run: | | |
export PATH="${{steps.path.outputs.path}}${PATH:+:${PATH}}" | |
python -m robot --outputdir reports-${{ matrix.target }}-${{ matrix.arch }} --settag ${{ matrix.target }}-${{ matrix.arch }} --name ${{ matrix.target }}-${{ matrix.arch }} . | |
- name: Archieve test results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: reports-${{ matrix.target }}-${{ matrix.arch }} | |
path: reports-${{ matrix.target }}-${{ matrix.arch }} |