From fec2f34dfc503c40f54d4bce0cc7a99ee2175b65 Mon Sep 17 00:00:00 2001 From: Seokhyun Lee <7948302+henrylee97@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:11:40 +0900 Subject: [PATCH] chore(cicd): make final step in ci on pr (#26) * chore: make final step in ci on pr * chore: does not skip reporting if no tests to run * fix: add permission to write on pr --- .github/workflows/check.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 5e2bdadd7..e4b14874e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,4 +1,4 @@ -name: Build benchmark images +name: Check on PR on: pull_request: @@ -61,3 +61,29 @@ jobs: run: | docker load --input ./image.tar docker run --rm benchmark:latest /bin/bash -c "cd ${{ steps.read-metadata.outputs.location }}; ${{ steps.read-metadata.outputs.buildCommand }}" + + check-all-test-pass-on-pr: + runs-on: ubuntu-latest + + permissions: + pull-requests: write + + needs: + - build-test + + if: always() + + steps: + - run: exit 1 + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + + - uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: ':mega: All tests passed!' + }) \ No newline at end of file