-
Notifications
You must be signed in to change notification settings - Fork 26
55 lines (53 loc) · 1.94 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
46
47
48
49
50
51
52
53
54
55
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"