Skip to content

Commit

Permalink
tock-hardware-ci: revert change to hwci path
Browse files Browse the repository at this point in the history
  • Loading branch information
charles37 committed Oct 28, 2024
1 parent cb21fc1 commit de191e7
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions .github/workflows/treadmill-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
name: treadmill-ci
env:
TERM: xterm # Makes tput work in actions output

on:
workflow_call:
inputs:
Expand All @@ -42,45 +41,37 @@ on:
tests:
required: false
type: string
default: "tests/c_hello.py" # Default to single test for backward compatibility

default: 'tests/c_hello.py' # Default to single test for backward compatibility
jobs:
test-prepare:
runs-on: ubuntu-latest

# Do not run job on forks, as they will not have the correct environment set up
if: github.repository == inputs.repository-filter
environment: ${{ inputs.job-environment }}

outputs:
tml-job-ids: ${{ steps.treadmill-job-launch.outputs.tml-job-ids }}
tml-jobs: ${{ steps.treadmill-job-launch.outputs.tml-jobs }}

steps:
- uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Checkout Treadmill repository
uses: actions/checkout@v4
with:
repository: treadmill-tb/treadmill
# treadmill-tb/treadmill main as of Oct 1, 2024, 3:05 PM EDT
ref: 'c82f4d7ebddd17f8275ba52139e64e04623f30cb'
path: treadmill

- name: Cache Treadmill CLI compilation artifacts
id: cache-tml-cli
uses: actions/cache@v4
with:
path: treadmill/target
key: ${{ runner.os }}-tml-cli

- name: Compile the Treadmill CLI binary
run: |
pushd treadmill
cargo build --package tml-cli
popd
echo "$PWD/treadmill/target/debug" >> "$GITHUB_PATH"
# - uses: actions/checkout@v4
# with:
# repository: tock/tock
Expand All @@ -90,30 +81,25 @@ jobs:
# - name: Analyze changes and determine types of tests to run
# run: |
# echo "TODO: implement this!"

- name: Generate a token to register new just-in-time runners
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.TREADMILL_GH_APP_CLIENT_ID }}
private-key: ${{ secrets.TREADMILL_GH_APP_PRIVATE_KEY }}

- name: Create GitHub just-in-time runners and enqueue Treadmill jobs
id: treadmill-job-launch
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
TML_API_TOKEN: ${{ secrets.TREADMILL_API_TOKEN }}

# Currently, all tests run only on hosts attached to an nRF52840DK
DUT_BOARD: nrf52840dk

# A Raspberry Pi OS netboot (NBD) image with a GitHub Actions
# self-hosted runner pre-configured.
#
# For the available images see
# https://book.treadmill.ci/treadmillci-deployment/images.html
IMAGE_ID: 1b6900eff30f37b6d012240f63aa77a22e20934e7f6ebf38e25310552dc08378

# Limit the supervisors to hosts that are compatible with this
# image. This is a hack until we introduce "image sets" which define
# multiple images for various supervisor hosts, but otherwise behave
Expand Down Expand Up @@ -177,17 +163,12 @@ jobs:
# Treadmill job we've started:
echo "tml-job-ids=[ \"$TML_JOB_ID\" ]" >> "$GITHUB_OUTPUT"
echo "tml-jobs={ \"$TML_JOB_ID\": { \"runner-id\": \"$RUNNER_ID\", \"tests\": $TEST_LIST } }" >> "$GITHUB_OUTPUT"
test-execute:
needs: test-prepare

strategy:
matrix:
tml-job-id: ${{ fromJSON(needs.test-prepare.outputs.tml-job-ids) }}

runs-on: ${{ fromJSON(needs.test-prepare.outputs.tml-jobs)[matrix.tml-job-id].runner-id }}

steps:
- name: Print Treadmill Job Context and Debug Information
run: |
Expand All @@ -206,36 +187,30 @@ jobs:
ls -lh /dev/ttyACM* 2>/dev/null || true
ls -lh /dev/ttyUSB* 2>/dev/null || true
ls -lh /dev/bus/usb/*/* 2>/dev/null || true
- name: Disable wget progress output
run: |
echo "verbose = off" >> $HOME/.wgetrc
- name: Checkout the Tock Hardware CI scripts
uses: actions/checkout@v4
with:
repository: tock/tock-hardware-ci
ref: ${{ inputs.tock-hardware-ci-ref }}

- name: Checkout the Tock kernel repository
uses: actions/checkout@v4
with:
path: tock
repository: tock/tock
ref: ${{ inputs.tock-kernel-ref }}

- name: Checkout the libtock-c repository
uses: actions/checkout@v4
with:
path: libtock-c
repository: tock/libtock-c
ref: ${{ inputs.libtock-c-ref }}

- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
# Avoid overwriting the RUSTFLAGS environment variable
rustflags: ""

rustflags: ''
- name: Install required system packages
run: |
# TODO: currently, the Netboot NBD targets have no access to their
Expand All @@ -254,30 +229,26 @@ jobs:
curl --proto '=https' --tlsv1.2 -LsSf \
https://github.com/probe-rs/probe-rs/releases/latest/download/probe-rs-tools-installer.sh \
| sh
- name: Create Python virtual environment and install required dependencies
run: |
python3 -m venv ./hwcienv
source ./hwcienv/bin/activate
pip install -r hwci/requirements.txt -c hwci/requirements-frozen.txt
- name: Run tests
env:
JSON_TEST_ARRAY: ${{ toJSON(fromJSON(needs.test-prepare.outputs.tml-jobs)[matrix.tml-job-id].tests) }}
run: |
source ./hwcienv/bin/activate
cd ./tools/hwci
cd ./hwci
export PYTHONPATH="$PWD:$PYTHONPATH"
echo "$JSON_TEST_ARRAY" | jq -r -c '.[]' | while read TEST; do
echo "===== RUNNING TEST $TEST ====="
python3 core/main.py --board boards/nrf52dk.py --test "$TEST" || echo "===== Test failed! ====="
done
- name: Request shutdown after successful job completion
run: |
sudo touch /run/github-actions-shutdown
- name: Provide connection information on job failure
if: failure()
run: |
Expand Down

0 comments on commit de191e7

Please sign in to comment.