-
Notifications
You must be signed in to change notification settings - Fork 33
45 lines (43 loc) · 1.47 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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: info
run: |
cd host
cargo test --test '*' -- --nocapture
- name: Update status
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"