mirror of
https://github.com/rommapp/romm.git
synced 2026-10-12 02:21:58 +00:00
81 lines
2.3 KiB
YAML
81 lines
2.3 KiB
YAML
name: Frontend Checks
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "frontend/**"
|
|
- ".github/actions/setup-frontend/**"
|
|
push:
|
|
branches:
|
|
- "master"
|
|
paths:
|
|
- "frontend/**"
|
|
- ".github/actions/setup-frontend/**"
|
|
|
|
# A new push cancels a PR's superseded run; each master commit keeps its own.
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up the frontend
|
|
uses: ./.github/actions/setup-frontend
|
|
|
|
# Stories run in browser mode, which needs only the headless shell.
|
|
- name: Install Playwright browser
|
|
run: npx playwright install --with-deps --only-shell chromium
|
|
working-directory: frontend
|
|
|
|
- name: Run tests (vitest, includes Storybook play() and a11y tests)
|
|
run: npm test
|
|
working-directory: frontend
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up the frontend
|
|
uses: ./.github/actions/setup-frontend
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
working-directory: frontend
|
|
|
|
typecheck:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up the frontend
|
|
uses: ./.github/actions/setup-frontend
|
|
|
|
- name: Run typecheck
|
|
run: npm run typecheck
|
|
working-directory: frontend
|
|
|
|
- name: Lockfile lint
|
|
run: |
|
|
[ -z "$(jq -r '.packages | to_entries[] | select((.key | contains("node_modules")) and (.value.resolved | contains("git+ssh") | not) and (.value | has("resolved") and has("integrity") | not)) | .key' < package-lock.json)" ]
|
|
working-directory: frontend
|