Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(pr-build): integrate check runs to report build status #162

Merged
merged 8 commits into from
Jul 14, 2023
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 }}