From 1a4dc39687a5bdae62ba5f2c9a6313801e69c87d Mon Sep 17 00:00:00 2001 From: Avimitin Date: Wed, 3 Apr 2024 04:35:56 +0800 Subject: [PATCH] Create test Signed-off-by: Avimitin --- .github/workflows/test.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000000..e89260f814 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,33 @@ +name: PR +on: [pull_request] +env: + USER: runner + +# Cancel the current workflow when new commit pushed +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + always-success: + name: "I will always success" + runs-on: [self-hosted, linux, nixos] + steps: + - name: "Success" + run: echo "FOO BAR BAZ" + + get-report: + name: "Getting report" + if: ${{ success() }} + runs-on: [self-hosted, linux, nixos] + needs: [always-success] + steps: + - name: "Fetch report" + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.T1_INHOUSE_PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "${{ secrets.T1_INHOUSE_URL }}" \ + -d '{"event_type":"ci_success","client_payload":{"commit_sha": "${{ github.event.pull_request.head.sha }}","pr_id": "${{ github.event.pull_request.number }}" }}'