Skip to content

chore(deps): refresh dependency and toolchain pins #180

chore(deps): refresh dependency and toolchain pins

chore(deps): refresh dependency and toolchain pins #180

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
types:
- opened
- reopened
- edited
- synchronize
- ready_for_review
push:
branches:
- main
merge_group:
permissions:
contents: read
env:
RUNNER_IMAGE: &runner-image ubuntu-24.04
DOCKER_BUILD_CACHE_SCOPE: cv-docker-build
NODE_OPTIONS: '--unhandled-rejections=strict'
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
setup:
name: Setup context
runs-on: *runner-image
outputs:
base_sha: ${{ steps.range.outputs.base_sha }}
head_sha: ${{ steps.range.outputs.head_sha }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Resolve commit range
id: range
env:
EVENT_NAME: ${{ github.event_name }}
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
BEFORE_SHA: ${{ github.event.before }}
CURRENT_SHA: ${{ github.sha }}
run: bash ./.github/scripts/ci/resolve-commit-range.sh
lint:
name: Lint
runs-on: *runner-image
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Bootstrap Node
uses: ./.github/actions/node-bootstrap
- name: Run lint
run: pnpm run lint
typecheck:
name: Typecheck
runs-on: *runner-image
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Bootstrap Node
uses: ./.github/actions/node-bootstrap
- name: Run typecheck
run: pnpm run typecheck
generate:
name: Generate static site
runs-on: *runner-image
env:
NEXT_PUBLIC_SITE_URL: https://95gabor.me
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Bootstrap Node
uses: ./.github/actions/node-bootstrap
- name: Prepare static site
run: CI=true bash scripts/prepare-static-site.sh
lighthouse:
name: Lighthouse (SEO + accessibility)
runs-on: *runner-image
permissions:
contents: read
issues: write
pull-requests: write
env:
NEXT_PUBLIC_SITE_URL: https://95gabor.me
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Bootstrap Node
uses: ./.github/actions/node-bootstrap
- name: Prepare static site
run: CI=true bash scripts/prepare-static-site.sh
- name: Run Lighthouse CI
id: lighthouse
uses: treosh/lighthouse-ci-action@v12
with:
configPath: ./.lighthouserc.json
uploadArtifacts: true
temporaryPublicStorage: true
- name: Upload Lighthouse filesystem reports
if: always()
uses: actions/upload-artifact@v7
with:
name: lighthouse-report
path: .lighthouseci/
if-no-files-found: warn
retention-days: 7
- name: Build Lighthouse PR comment body
id: lighthouse_comment
if: >-
always() &&
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
env:
LIGHTHOUSE_MANIFEST: ${{ steps.lighthouse.outputs.manifest }}
LIGHTHOUSE_LINKS: ${{ steps.lighthouse.outputs.links }}
COMMENT_MARKER: '<!-- pr-lighthouse-results -->'
COMMENT_BODY_FILE: lighthouse-pr-comment.md
run: node ./.github/scripts/ci/lighthouse/build-comment-body.js
- name: Comment Lighthouse results on pull request
if: >-
always() &&
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
env:
GH_TOKEN: ${{ github.token }}
ISSUE_NUMBER: ${{ github.event.pull_request.number }}
COMMENT_MARKER: '<!-- pr-lighthouse-results -->'
COMMENT_BODY_FILE: lighthouse-pr-comment.md
run: bash ./.github/scripts/ci/upsert-pr-comment.sh
e2e:
name: Playwright E2E
runs-on: *runner-image
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Bootstrap Node
uses: ./.github/actions/node-bootstrap
- name: Install Playwright browser
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
run: pnpm run test:e2e
env:
CI: true
NEXT_PUBLIC_SITE_URL: https://95gabor.me
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v7
with:
name: playwright-report
path: playwright-report/
retention-days: 7
commitlint-title:
name: Validate PR title
if: github.event_name == 'pull_request'
runs-on: *runner-image
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Bootstrap Node
uses: ./.github/actions/node-bootstrap
- name: Lint PR title (Conventional Commits)
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: echo "$PR_TITLE" | npx commitlint
commitlint-commits:
name: Validate PR commits
if: github.event_name == 'pull_request'
needs: setup
runs-on: *runner-image
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Bootstrap Node
uses: ./.github/actions/node-bootstrap
- name: Lint commit messages in PR range
run: >-
npx commitlint
--from "${{ needs.setup.outputs.base_sha }}"
--to "${{ needs.setup.outputs.head_sha }}"
--verbose
visual-regression:
name: PR visual regression (Percy)
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
!github.event.pull_request.draft
runs-on: *runner-image
permissions:
contents: write
issues: write
pull-requests: write
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Bootstrap Node
uses: ./.github/actions/node-bootstrap
- name: Install Playwright browser
run: npx playwright install --with-deps chromium
- name: Run Percy visual snapshot tests
run: |
export PERCY_BROWSER_EXECUTABLE="$(node --input-type=module -e "import { chromium } from '@playwright/test'; console.log(chromium.executablePath())")"
pnpm run test:e2e:visual:ci
test -f artifacts/screenshots/cv-full-page.png
- name: Upload full-page screenshot artifact
if: always()
uses: actions/upload-artifact@v7
with:
name: pr-full-page-screenshot
path: artifacts/screenshots/*.png
if-no-files-found: error
retention-days: 7
- name: Publish screenshot for PR comment
id: publish_screenshot
env:
TARGET_BRANCH: pr-visual-snapshots
PR_NUMBER: ${{ github.event.pull_request.number }}
SCREENSHOT_FILE: artifacts/screenshots/cv-full-page.png
run: bash ./.github/scripts/ci/pr-screenshot/publish-screenshot.sh
- name: Build screenshot PR comment body
if: steps.publish_screenshot.outputs.screenshot_url != ''
env:
SCREENSHOT_URL: ${{ steps.publish_screenshot.outputs.screenshot_url }}
COMMENT_BODY_FILE: pr-screenshot-comment.md
run: bash ./.github/scripts/ci/pr-screenshot/build-comment-body.sh
- name: Comment screenshot on pull request
if: steps.publish_screenshot.outputs.screenshot_url != ''
env:
GH_TOKEN: ${{ github.token }}
ISSUE_NUMBER: ${{ github.event.pull_request.number }}
COMMENT_MARKER: '<!-- pr-full-page-screenshot -->'
COMMENT_BODY_FILE: pr-screenshot-comment.md
run: bash ./.github/scripts/ci/upsert-pr-comment.sh
docker-build:
name: Validate Docker build
runs-on: *runner-image
env:
NEXT_PUBLIC_SITE_URL: https://95gabor.me
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Bootstrap Node
uses: ./.github/actions/node-bootstrap
- name: Prepare Supabase for Docker build
id: docker_build_env
uses: ./.github/actions/docker-build-env
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build Docker image (no push)
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile
push: false
tags: cv:ci
build-args: |
NEXT_PUBLIC_SITE_URL=${{ env.NEXT_PUBLIC_SITE_URL }}
secret-files: |
supabase_url=${{ steps.docker_build_env.outputs.supabase_url_file }}
supabase_publishable_key=${{ steps.docker_build_env.outputs.supabase_publishable_key_file }}
add-hosts: |
host.docker.internal:172.17.0.1
cache-from: type=gha,scope=${{ env.DOCKER_BUILD_CACHE_SCOPE }}
cache-to: type=gha,mode=max,scope=${{ env.DOCKER_BUILD_CACHE_SCOPE }}