Files
kener/.github/workflows/test.yml
T
Florian Kostenzer 385fb63d55 ci: cancel superseded test runs on the same branch or PR
Add a workflow-level concurrency group keyed by workflow + ref with
cancel-in-progress, so pushing a new commit cancels the still-running
test job for the previous commit on that branch/PR.
2026-07-15 17:52:53 +02:00

52 lines
1.2 KiB
YAML

name: Tests
on:
push:
branches:
- main
pull_request:
# Cancel superseded runs on the same branch / PR to save CI minutes.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
with:
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Get Playwright version
id: playwright-version
run: echo "version=$(npx playwright --version | awk '{print $2}')" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
- name: Install Playwright Chromium
run: npx playwright install --with-deps chromium
- name: Type check
run: npm run check
- name: Run tests
run: npm test