-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (96 loc) · 2.51 KB
/
Copy pathtest.yml
File metadata and controls
115 lines (96 loc) · 2.51 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
changes:
runs-on: ubuntu-latest
outputs:
tools: ${{ steps.filter.outputs.tools }}
app: ${{ steps.filter.outputs.app }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect changed paths
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
tools:
- "tools/**"
app:
- "src/**"
- "public/**"
- "package.json"
- "pnpm-lock.yaml"
- "next.config.ts"
- "tsconfig.json"
- "vite.config.ts"
- "vitest.config.ts"
- "biome.json"
- ".github/workflows/test.yml"
test:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.app == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Run lint
run: pnpm lint
- name: Run tests with coverage
run: pnpm test:coverage
build:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.app == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Run build
run: pnpm build
tools-test:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.tools == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v1
with:
python-version: "3.12"
- name: Sync env with uv
working-directory: tools
run: uv sync --frozen
- name: Run tools unit tests
working-directory: tools
run: uv run python -m unittest discover -s tests