From 209649aaaf1fae0e08b906a2f78e775ada3a884b Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Thu, 2 May 2024 09:14:37 +0200 Subject: [PATCH] Use rodbot to provide authenticated testing --- .github/rodbot.yaml | 11 +++++++++++ .github/workflows/ci.yaml | 12 ------------ .github/workflows/rodbot.yaml | 24 ++++++++++++++++++++++++ .github/workflows/tests.yaml | 18 ++++++++++++++++++ 4 files changed, 53 insertions(+), 12 deletions(-) create mode 100644 .github/rodbot.yaml create mode 100644 .github/workflows/rodbot.yaml create mode 100644 .github/workflows/tests.yaml diff --git a/.github/rodbot.yaml b/.github/rodbot.yaml new file mode 100644 index 00000000..20d308f4 --- /dev/null +++ b/.github/rodbot.yaml @@ -0,0 +1,11 @@ +on: + issue_comment: + - if: + - command: "test" + - user_is: ["MEMBER", "OWNER"] + - is_pr + steps: + - run: | + gh workflow run tests.yaml -R embassy-rs/trouble -F prNr=${{ github.event.issue.number }} + - run: | + gh pr comment ${{ github.event.issue.number }} -b "Aye, aye, captain! … Triggered Test worklow!" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1f1be421..53dee5ea 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,15 +28,3 @@ jobs: - name: Build examples run: for i in nrf-sdc; do pushd examples/$i; cargo fmt --check && cargo clippy && cargo build --release; popd; done; - #integration-tests: - # runs-on: self-hosted - # steps: - # - uses: actions/checkout@v4 - # - name: Build - # env: - # TEST_ADAPTER_ONE: /dev/ttyACM0 - # TEST_ADAPTER_TWO: /dev/ttyACM1 - # RUST_LOG: info - # run: | - # cd host - # cargo test --test '*' -- --nocapture diff --git a/.github/workflows/rodbot.yaml b/.github/workflows/rodbot.yaml new file mode 100644 index 00000000..330285cd --- /dev/null +++ b/.github/workflows/rodbot.yaml @@ -0,0 +1,24 @@ +name: rodbot + +on: + issue_comment: + types: [ "created" ] + +jobs: + rodbot: + runs-on: ubuntu-22.04 + + env: + GH_TOKEN: ${{ secrets.BOT_PAT }} + + steps: + - run: | + echo $GITHUB_EVENT_PATH + cat $GITHUB_EVENT_PATH + + - name: Checkout + uses: actions/checkout@v3 + + - uses: ctron/rodbot-action@v0.1 + with: + config: .github/rodbot.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 00000000..f08e8b39 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,18 @@ +name: Tests + +on: + workflow_dispatch: {} + +jobs: + integration-tests: + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + - name: Build + env: + TEST_ADAPTER_ONE: /dev/ttyACM0 + TEST_ADAPTER_TWO: /dev/ttyACM1 + RUST_LOG: info + run: | + cd host + cargo test --test '*' -- --nocapture