-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (83 loc) · 2.4 KB
/
web-lint.yaml
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
---
name: Web Lint
on:
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- main
- develop
paths:
# Check if a project file changed
- "projects/**/src/**/*.{tsx,ts,css}"
# Check if a dependency changed
- "projects/**/package.json"
- "**/pnpm-workspace.yaml"
# Check if a configuration file changed
- "**/eslint.config.mjs"
- "**/stylelint.config.mjs"
workflow_dispatch:
permissions:
contents: read
pull-requests: read
checks: write
jobs:
install-deps:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: "10.x"
- name: Setup Node.JS
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- name: Cache node_modules
id: cache
uses: actions/cache@v4
with:
path: node_modules
key: cache-node-modules-${{ hashFiles('pnpm-lock.yaml') }}
- name: pnpm install
if: steps.cache.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
web-lint:
runs-on: ubuntu-latest
needs: [install-deps]
strategy:
matrix:
target: [build, lint:js, lint:css]
jobIndex: [1, 2, 3, 4]
env:
jobCount: 4
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v4
with:
path: node_modules
key: cache-node-modules-${{ hashFiles('pnpm-lock.yaml') }}
- name: Cache NX
uses: actions/cache@v4
with:
path: node_modules/.cache/nx
key: cache-nx-${{ hashFiles('pnpm-lock.yaml') }}-${{ matrix.target }}-${{ github.sha }}
restore-keys: |
cache-nx-${{ hashFiles('pnpm-lock.yaml') }}-${{ matrix.target }}-
cache-nx-${{ hashFiles('pnpm-lock.yaml') }}-
- run: git fetch --no-tags --prune --depth=1 origin main
- name: Print Environment Info
run: pnpm exec nx report
- name: nx run-many:${{ matrix.target }}
run: node ./configs/run-many.mjs "${{ matrix.target }}" "${{ matrix.jobIndex }}" "${{ env.jobCount }}" "$GITHUB_REF"