mirror of
https://github.com/joinmarket-webui/jam.git
synced 2026-08-13 12:33:26 +02:00
62 lines
1.7 KiB
YAML
62 lines
1.7 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [master, devel]
|
|
pull_request:
|
|
branches: [master, devel]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: ['v26.5.0']
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup (Node.js ${{ matrix.node-version }})
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Install
|
|
run: npm clean-install --no-audit --no-fund
|
|
|
|
- name: Get installed Playwright version
|
|
id: playwright-version
|
|
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').packages['node_modules/@playwright/test'].version)")" >> $GITHUB_ENV
|
|
|
|
- name: Cache Playwright
|
|
uses: actions/cache@v5
|
|
id: playwright-cache
|
|
with:
|
|
path: |
|
|
~/.cache/ms-playwright
|
|
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
|
|
|
|
- run: npx playwright install --with-deps
|
|
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
|
|
|
- run: npx playwright install-deps
|
|
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
|
|
|
- name: Lint
|
|
run: npm run lint
|
|
|
|
- name: Format check
|
|
run: npm run format:check
|
|
|
|
- name: Test
|
|
run: npm run test:coverage
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Upload coverage report
|
|
# Set if: always() to also generate the report if tests are failing
|
|
# Only works if you set `reportOnFailure: true` in vite config
|
|
if: ${{ always() && hashFiles('coverage/coverage-summary.json') != '' }}
|
|
uses: davelosert/vitest-coverage-report-action@v2
|