Skip to content

Commit

Permalink
Add dev binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
soumeh01 committed May 29, 2024
1 parent ae700ec commit 1ecdf7d
Show file tree
Hide file tree
Showing 6 changed files with 10,060 additions and 80 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/e2e_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-13]
arch: [amd64, arm64]
arch: [amd64]
include:
- os: windows-latest
target: win
- os: ubuntu-latest
target: lin
- os: macos-13
target: mac

steps:
- uses: actions/checkout@v4

Expand All @@ -54,8 +55,15 @@ jobs:
armlm activate --server https://mdk-preview.keil.arm.com --product KEMDK-COM0
working-directory: ./test

- name: Env check
shell: bash
run: |
echo $PATH
- name: Run Test
shell: bash
run: |
echo $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
Expand Down Expand Up @@ -94,9 +102,9 @@ jobs:
working-directory: artifacts
run: |
python -m robot.rebot --name Collective_Robot_Results --outputdir collective_robot_results --output output.xml \
./reports-win-amd64/output.xml ./reports-win-arm64/output.xml \
./reports-lin-amd64/output.xml ./reports-lin-arm64/output.xml \
./reports-mac-amd64/output.xml ./reports-mac-arm64/output.xml
./reports-win-amd64/output.xml \
./reports-lin-amd64/output.xml \
./reports-mac-amd64/output.xml
- name: Generate Summary report
if: always()
Expand Down
289 changes: 215 additions & 74 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: Download Nightly Assets
name: nightly

# This workflow picks up the latest changes from the toolbox binaries
# and runs end-to-end tests to detect regressions. It is triggered by:
# 1. A schedule set for every midnight
# 2. Manual triggering of the workflow
# 3. Changes to the workflow file

on:
# schedule:
# - cron: '0 0 * * *' # Runs daily at midnight
workflow_dispatch: # Allows manual triggering of the workflow
workflow_dispatch: # Manual triggering of the workflow
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
pull_request:
paths:
- '.github/workflows/nightly.yml'
Expand All @@ -13,15 +19,15 @@ concurrency:
cancel-in-progress: true

jobs:
download-assets:
create-toolbox:
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-13]
arch: [amd64, arm64]
os: [windows-2019, ubuntu-latest, macos-13]
arch: [amd64]
include:
- os: windows-latest
- os: windows-2019
target: windows
extn: .exe
- os: ubuntu-latest
Expand All @@ -31,15 +37,146 @@ jobs:
target: darwin
extn:
steps:
- name: Checkout repository
- 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: Update toolchain config files
if: ${{ matrix.target == 'windows' }}
shell: bash
run: |
sed -i '/set(EXT/c\ set(EXT .exe)' ./cmsis-toolbox/etc/AC6.6.16.2.cmake
sed -i '/set(EXT/c\ set(EXT .exe)' ./cmsis-toolbox/etc/GCC.10.3.1.cmake
sed -i '/set(EXT/c\ set(EXT .exe)' ./cmsis-toolbox/etc/IAR.9.32.1.cmake
sed -i '/set(EXT/c\ set(EXT .exe)' ./cmsis-toolbox/etc/CLANG.17.0.1.cmake
- 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-2019, ubuntu-22.04, macos-12]
arch: [amd64, arm64]
include:
- os: windows-2019
target: windows
extn: .exe
- os: ubuntu-22.04
target: linux
extn:
- os: macos-12
target: darwin
extn:
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
Expand All @@ -51,93 +188,97 @@ jobs:
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
# gh auth login --with-token < "${{ secrets.GITHUB_TOKEN }}"

- name: Get latest nightly projmgr artifacts
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 "PROJMGR_LATEST_RUN_ID=$RUN_ID" >> $GITHUB_OUTPUT
- name: Download ProjMgr nightly artifacts
shell: bash
run : |
gh run download -D projmgr-${{ matrix.target }}-${{ matrix.arch }} ${{ steps.get_run_id.outputs.PROJMGR_LATEST_RUN_ID }} -n projmgr-${{ matrix.target }}-${{ matrix.arch }} -R Open-CMSIS-Pack/devtools
- name: List downloaded files
shell: bash
run: ls -l projmgr-${{ matrix.target }}-${{ matrix.arch }}

- name: csolution version before
shell: bash
run: |
csolution -V
- 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 binary path
- name: Get installed path
if: always()
id: toolbox_path
shell: bash
run: |
CSOLUTION_PATH=$(which csolution)
BIN_DIR=$(dirname $CSOLUTION_PATH)
echo "$BIN_DIR"
cp ./projmgr-${{ matrix.target }}-${{ matrix.arch }}/csolution${{ matrix.extn }} $BIN_DIR/csolution${{ matrix.extn }}
echo "set path variable with new path"
echo "$(pwd)/cmsis-toolbox/bin"
echo "path=$(echo "$(pwd)/cmsis-toolbox/bin")" >> $GITHUB_OUTPUT
- name: List downloaded files
- name: List files
shell: bash
run: |
CSOLUTION_PATH=$(which cbuild)
BIN_DIR=$(dirname $CSOLUTION_PATH)
ls -l $BIN_DIR
- name: csolution version after
ls -l $(pwd)/cmsis-toolbox/bin
ls -l ./cmsis-toolbox/etc
- name: Print Info
shell: bash
run: |
csolution -V
echo "${{steps.toolbox_path.outputs.path}}"
- name: Run Test
shell: bash
run: |
export PATH="${{steps.toolbox_path.outputs.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 }}

# - 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
consolidate-report:
if: always()
needs: [run-tests]
runs-on: ubuntu-latest
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-linux-amd64/output.xml \
./reports-darwin-amd64/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

Loading

0 comments on commit 1ecdf7d

Please sign in to comment.