From 2c67e4f3fc822c1e91b3234c5e17acc2671a156f Mon Sep 17 00:00:00 2001 From: Kevin Yu <31861128+yqlbu@users.noreply.github.com> Date: Fri, 14 Jul 2023 11:13:33 +0800 Subject: [PATCH] ci(pr-build): integrate check runs to report build status (#162) * ci(pr-build): integrate check runs to report build status * ci(pr-build): integrate individual check run per stage * chore: add title for check-run step * ci(pr-build): add instantiate-check-runs stage * chore: remove conclusion input * refactor: rework instantiate-check-runs stage * Update pr-build.yml * ci(pr-build): instantiate build-passed check run --- .github/workflows/pr-build.yml | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 20b8bb20..f5627942 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -18,6 +18,19 @@ jobs: GITHUB_CONTEXT: ${{ toJson(github) }} run: | echo "$GITHUB_CONTEXT" + + instantiate-check-runs: + runs-on: ubuntu-latest + strategy: + matrix: + id: ["checkout-full-src", "build-web", "build-bundle", "build-passed"] + steps: + - name: Instantiate required check runs + uses: daeuniverse/ci-seed-jobs/core/daed/instantiate-check-runs@master + with: + app_id: ${{ secrets.GH_APP_ID }} + private_key: ${{ secrets.GH_APP_PRIVATE_KEY }} + id: "dae-bot[bot]/${{ matrix.id }}" checkout-full-src: runs-on: ubuntu-latest @@ -47,10 +60,19 @@ jobs: shasum -a 512 $FILE >>$DGST - name: Upload artifact - full source + id: upload_artifact uses: actions/upload-artifact@v3 with: name: daed-full-src.zip path: daed-full-src.zip + + - name: Report result + uses: daeuniverse/ci-seed-jobs/core/daed/report-check-run@master + if: always() + with: + app_id: ${{ secrets.GH_APP_ID }} + private_key: ${{ secrets.GH_APP_PRIVATE_KEY }} + id: "dae-bot[bot]/checkout-full-src" build-web: runs-on: ubuntu-latest @@ -72,10 +94,19 @@ jobs: pnpm build - name: Upload artifact - web + id: upload_artifact uses: actions/upload-artifact@v3 with: name: web path: dist + + - name: Report result + uses: daeuniverse/ci-seed-jobs/core/daed/report-check-run@master + if: always() + with: + app_id: ${{ secrets.GH_APP_ID }} + private_key: ${{ secrets.GH_APP_PRIVATE_KEY }} + id: "dae-bot[bot]/build-web" build-bundle: needs: build-web @@ -216,3 +247,25 @@ jobs: with: name: ${{ steps.get_filename.outputs.BUNDLE_NAME }} path: bundled/* + + - name: Report result + uses: daeuniverse/ci-seed-jobs/core/daed/report-check-run@master + if: always() + with: + app_id: ${{ secrets.GH_APP_ID }} + private_key: ${{ secrets.GH_APP_PRIVATE_KEY }} + id: "dae-bot[bot]/build-bundle" + + conclusion: + if: always() + needs: [build-bundle] + runs-on: ubuntu-latest + steps: + - name: Report workflow run result + uses: daeuniverse/ci-seed-jobs/core/daed/report-workflow-run@master + with: + app_id: ${{ secrets.GH_APP_ID }} + private_key: ${{ secrets.GH_APP_PRIVATE_KEY }} + id: "dae-bot[bot]/build-passed" + conclusion: ${{ needs.build-bundle.result }} +