From e8f5637cd989cdd6bc82f3111853a230a3eb3fcd Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Tue, 26 Sep 2023 20:07:15 -0400 Subject: [PATCH 1/2] Move performance checks to privileged runner --- .github/workflows/build-preview.yml | 10 ---------- .github/workflows/deploy-pr-checks.yml | 13 +++++++++++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-preview.yml b/.github/workflows/build-preview.yml index 01deab3ba..487752e32 100644 --- a/.github/workflows/build-preview.yml +++ b/.github/workflows/build-preview.yml @@ -63,16 +63,6 @@ jobs: echo '${{ env.MAIN_STATS }}' echo '${{ env.PR_STATS }}' npm exec ts-node scripts/stats_compare '${{ env.MAIN_STATS }}' '${{ env.PR_STATS }}' > pr/stats-difference.md - - name: Print Stats to GitHub Checks - uses: LouisBrunner/checks-action@v1.6.1 - if: always() - with: - token: ${{ secrets.GITHUB_TOKEN }} - name: Performance Metrics - conclusion: neutral - output: | - {"summary":"Style size changes introduced by this PR"} - output_text_description_file: pr/stats-difference.md - name: Upload Build artifact uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/deploy-pr-checks.yml b/.github/workflows/deploy-pr-checks.yml index 1c2d27bae..57babd8e2 100644 --- a/.github/workflows/deploy-pr-checks.yml +++ b/.github/workflows/deploy-pr-checks.yml @@ -126,6 +126,15 @@ jobs: conclusion: neutral output: | {"summary":"Preview map changes introduced by this PR", "title":"View live map and artifacts"} - images: | - [{"image_url":"https://preview.ourmap.us/pr/${{ env.PR_NUM }}/sprites/sprite.png", "caption":"Sprite Sheet", "alt":"1x Sprite Sheet"}] output_text_description_file: pr_preview.md + - name: Print Stats to GitHub Checks + uses: LouisBrunner/checks-action@v1.6.1 + if: always() + with: + sha: ${{ env.PR_SHA }} + token: ${{ steps.checks_token.outputs.token }} + name: Style Performance + conclusion: neutral + output: | + {"summary":"Style size changes introduced by this PR", "title":"View metrics on style size changes"} + output_text_description_file: stats-difference.md From 1f10c0ea3f678b09088878239edc249eaab09435 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Tue, 26 Sep 2023 20:09:28 -0400 Subject: [PATCH 2/2] Re-order CI --- .github/workflows/build-preview.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-preview.yml b/.github/workflows/build-preview.yml index 487752e32..d1ffd9423 100644 --- a/.github/workflows/build-preview.yml +++ b/.github/workflows/build-preview.yml @@ -49,6 +49,11 @@ jobs: npm run style npm run shields cp src/configs/config.aws.js src/config.js + - name: Upload Build artifact + uses: actions/upload-artifact@v3 + with: + name: americana + path: dist/ - name: Capture PR branch usage statistics id: pr-stats run: | @@ -63,11 +68,6 @@ jobs: echo '${{ env.MAIN_STATS }}' echo '${{ env.PR_STATS }}' npm exec ts-node scripts/stats_compare '${{ env.MAIN_STATS }}' '${{ env.PR_STATS }}' > pr/stats-difference.md - - name: Upload Build artifact - uses: actions/upload-artifact@v3 - with: - name: americana - path: dist/ - name: Save PR artifacts env: PR_NUMBER: ${{ github.event.pull_request.number }}