Skip to content

Commit

Permalink
Update e2e_test.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
soumeh01 committed May 23, 2024
1 parent 0877b20 commit 13ffd7a
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/e2e_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: E2E Tests
on:
pull_request:
paths:
- '.github/workflows/robot-tests.yml'
- '.github/workflows/e2e_test.yaml'
- 'test/**'
- '!test/RobotTests.md'
- '!test/tests.py'
Expand Down
121 changes: 121 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
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.yaml'

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
run: gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"

- name: Get latest nightly projmgr artifacts
id: get_run_id
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
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
run: ls -l projmgr-${{ matrix.target }}-${{ matrix.arch }}

- name: csolution version before
run: |
csolution -V
- name: Get binary path
run: |
CSOLUTION_PATH=$(which csolution)
BIN_DIR=$(dirname $(dirname $CSOLUTION_PATH))
cp ./projmgr-${{ matrix.target }}-${{ matrix.arch }}/csolution${{ matrix.extn }}
- name: csolution version after
run: |
csolution -V
- name: Run Test
run: |
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

0 comments on commit 13ffd7a

Please sign in to comment.