mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-08-28 19:47:49 +08:00
94 lines
2.0 KiB
YAML
94 lines
2.0 KiB
YAML
name: Frontend Tests
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- v3
|
|
push:
|
|
branches:
|
|
- v3
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
format:
|
|
if: github.event_name == 'pull_request'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: '24'
|
|
cache: yarn
|
|
cache-dependency-path: yarn.lock
|
|
|
|
- name: Install dependencies
|
|
run: yarn --frozen-lockfile
|
|
|
|
- name: Check changed-file formatting
|
|
env:
|
|
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
run: yarn format:check --base "$BASE_SHA" --head "$HEAD_SHA"
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: '24'
|
|
cache: yarn
|
|
cache-dependency-path: yarn.lock
|
|
|
|
- name: Install dependencies
|
|
run: yarn --frozen-lockfile
|
|
|
|
- name: Lint
|
|
run: yarn lint
|
|
|
|
- name: Typecheck
|
|
run: yarn typecheck
|
|
|
|
typecheck-and-tests:
|
|
runs-on: ubuntu-latest
|
|
name: Unit tests (${{ matrix.shard }})
|
|
timeout-minutes: 20
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
shard:
|
|
- 1/2
|
|
- 2/2
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: '24'
|
|
cache: yarn
|
|
cache-dependency-path: yarn.lock
|
|
|
|
- name: Install dependencies
|
|
run: yarn --frozen-lockfile
|
|
|
|
- name: Unit tests
|
|
run: yarn test:run --shard=${{ matrix.shard }} --silent=passed-only
|