Skip to content

Commit

Permalink
ci(pr-build): integrate check runs to report build status (#162)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
piyoki authored Jul 14, 2023
1 parent c3b57f8 commit 2c67e4f
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 }}

0 comments on commit 2c67e4f

Please sign in to comment.