chore(deps): update dependency @codecov/vite-plugin to v1.5.0 #87
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: π Preview | |
on: | |
pull_request: | |
paths: | |
- "**.astro" | |
- "**.ts" | |
- bun.lockb | |
- "!**.test.ts" | |
jobs: | |
deploy: | |
name: π Deploy to the Preview | |
runs-on: Ubuntu-Latest | |
outputs: | |
url: ${{ steps.deploy.outputs.deployment-url }} | |
steps: | |
- name: π Checkout Repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: π Setup Bun with Cache | |
uses: 5ouma/utils/setup-bun-with-cache@main | |
- name: πΎ Create a Meta File | |
run: echo '${{ vars.META_FILE }}' >meta.json | |
- name: π οΈ Build | |
run: bun run build | |
- name: β οΈ Deploy to the Preview | |
id: deploy | |
uses: cloudflare/wrangler-action@6d58852c35a27e6034745c5d0bc373d739014f7f # v3.13.0 | |
with: | |
command: pages deploy dist --project-name='${{ github.event.repository.name }}' | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
lighthouse: | |
name: π¦ Analyze Performance | |
permissions: | |
pull-requests: write | |
needs: deploy | |
runs-on: Ubuntu-Latest | |
steps: | |
- name: π¦ Analyze Performance with Lighthouse | |
id: lighthouse | |
uses: treosh/lighthouse-ci-action@2f8dda6cf4de7d73b29853c3f29e73a01e297bd8 # 12.1.0 | |
with: | |
urls: ${{ needs.deploy.outputs.url }} | |
- name: π Arrange the Summary | |
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
id: summary | |
with: | |
result-encoding: string | |
script: | | |
const manifest = ${{ steps.lighthouse.outputs.manifest }}; | |
const gauge = Object.entries(manifest[0].summary).map(([label, percentage]) => { | |
const score = Math.round(percentage * 100); | |
const icon = score >= 90 ? "π’" : score >= 50 ? "π§" : "πΊ"; | |
return { label, score: `${icon} ${score}` }; | |
}); | |
const labels = `| ${gauge.map(({ label }) => label).join(" | ")} |`; | |
const scores = `| ${gauge.map(({ score }) => score).join(" | ")} |`; | |
return `${labels}\n| ${gauge.map(() => ":-:").join(" | ")} |\n${scores}`; | |
- name: π¬ Comment the Result | |
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2 | |
with: | |
message: | | |
## π¦ Lighthouse Result | |
${{ steps.summary.outputs.result }} | |
<details><summary>π Score Scale</summary> | |
| Fail | Average | Pass | | |
| :-----: | :------: | :-------: | | |
| πΊ 0-49 | π§ 50-89 | π’ 90-100 | | |
</details> | |
message-id: lighthouse |