mirror of
https://github.com/rajnandan1/kener.git
synced 2026-08-07 07:14:56 +00:00
385fb63d55
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.
52 lines
1.2 KiB
YAML
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
|