Skip to content

New Design

New Design #21

Workflow file for this run

name: Verify PR build
on:
pull_request:
branches: [ 'main', 'master' ]
concurrency:
group: '${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}'
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./spock-website
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Verify LFS files
run: |
git lfs install
git lfs fsck --pointers HEAD
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: 24 # LTS
cache: 'npm'
cache-dependency-path: spock-website/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Upload artifact
uses: actions/upload-artifact@v5
with:
name: 'gh-pages-preview'
path: './spock-website/dist'
link-check:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./spock-website
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: 24 # LTS
cache: 'npm'
cache-dependency-path: spock-website/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Check for broken links
run: npx linkinator ./dist/
visual-regression-tests:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.57.0-noble
options: --user 0 # Run as root to allow installation of git-lfs
defaults:
run:
working-directory: ./spock-website
steps:
# Unlike the default image, the playwright image does not have git-lfs installed
- name: Install git-lfs and switch to non-root user
run: |
apt-get update
apt-get install -y git-lfs
su - $(id -un 1001)
working-directory: ./ # the default only exists after checkout
- name: Checkout
uses: actions/checkout@v6
with:
lfs: true # Download LFS files for screenshots
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: 'npm'
cache-dependency-path: spock-website/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run Playwright Tests
run: npx playwright test
env:
# Firefox is unable to launch if the $HOME folder isn't owned by the current user.
# This is a workaround for running in a container.
HOME: /root
- name: Upload Test Results (optional)
uses: actions/upload-artifact@v5
if: always()
with:
name: playwright-report
path: spock-website/playwright-report/