forked from sleepypod/core
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.55 KB
/
test.yml
File metadata and controls
56 lines (47 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
name: ${{ matrix.task.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
task:
- { name: "Lint", cmd: "CHANGED=$(git diff --name-only --diff-filter=d origin/${{ github.event.pull_request.base.ref }}...HEAD -- '*.ts' '*.tsx' | head -200); if [ -n \"$CHANGED\" ]; then echo \"$CHANGED\" | xargs pnpm eslint; else echo 'No TS/TSX files changed'; fi" }
- { name: "Typecheck", cmd: "pnpm tsc" }
- { name: "Unit Tests", cmd: "pnpm test run --coverage --passWithNoTests" }
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v5
with:
run_install: false
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: "lts/*"
cache: 'pnpm'
registry-url: 'https://npm.pkg.github.com'
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Cache Assets (Vitest)
id: asset-cache
uses: actions/cache@v5
with:
path: |
.vitest
key: assets-${{ runner.os }}-${{ hashFiles('src/db/schema.ts', 'vitest.config.ts') }}
- name: Run Task
run: ${{ matrix.task.cmd }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_ENV: test