From c7d3959fcbbdffa69f78c2213af437b566180cdc Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Thu, 2 May 2024 14:52:23 +0200 Subject: [PATCH] Set PR status --- .github/workflows/tests.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 60dad24..88afc8d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -12,16 +12,23 @@ jobs: runs-on: self-hosted steps: - uses: actions/checkout@v4 - - name: Checkout PR + - name: Checkout + id: checkout env: GH_TOKEN: ${{ github.token }} run: | gh pr checkout "${{ github.event.inputs.prNr }}" - - name: Build + echo "commit=$(git rev-parse --verify HEAD)" >> "$GITHUB_OUTPUT" + - name: Test env: TEST_ADAPTER_ONE: /dev/ttyACM0 TEST_ADAPTER_TWO: /dev/ttyACM1 RUST_LOG: info run: | + env: + COMMIT: ${{ steps.checkout.outputs.commit }} cd host cargo test --test '*' -- --nocapture + 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"