Skip to content

Tests

Tests #182

Workflow file for this run

name: Tests
on:
workflow_dispatch:
inputs:
prNr:
description: A PR number to build
required: true
jobs:
integration-tests:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Checkout
id: checkout
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr checkout "${{ github.event.inputs.prNr }}"
echo "commit=$(git rev-parse --verify HEAD)" >> "$GITHUB_OUTPUT"
- name: Set pending
env:
COMMIT: ${{ steps.checkout.outputs.commit }}
GH_TOKEN: ${{ github.token }}
run: |
gh api --method POST -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" /repos/embassy-rs/trouble/statuses/${COMMIT} \
-f "state=pending" -f "description=Running tests" -f "context=tests"
- name: Test
env:
TEST_ADAPTER_ONE: /dev/ttyACM0
TEST_ADAPTER_TWO: /dev/ttyACM1
RUST_LOG: trace
run: |
cd host
cargo test --features log --test '*' -- --nocapture
- name: Update failed status
if: failure()
env:
COMMIT: ${{ steps.checkout.outputs.commit }}
GH_TOKEN: ${{ github.token }}
run: |
gh api --method POST -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" /repos/embassy-rs/trouble/statuses/${COMMIT} \
-f "state=failure" -f "description=The build failed" -f "context=tests"
- name: Update success status
if: success()
env:
COMMIT: ${{ steps.checkout.outputs.commit }}
GH_TOKEN: ${{ github.token }}
run: |
gh api --method POST -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" /repos/embassy-rs/trouble/statuses/${COMMIT} \
-f "state=success" -f "description=The build succeeded!" -f "context=tests"