-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (60 loc) · 2.04 KB
/
ci.yml
File metadata and controls
61 lines (60 loc) · 2.04 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
---
name: 👮 CI
on: pull_request
env:
HUSKY: 0
permissions:
contents: read
jobs:
lint:
strategy:
matrix:
version: [20, 22, 24]
name: 🧹 Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
with:
node-version: ${{ matrix.version }}
cache: npm
- run: npm ci --no-audit --no-fund --prefer-offline
- run: npx --no-install eslint src
test:
strategy:
matrix:
version: [20, 22, 24]
name: 🧪 Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
with:
node-version: ${{ matrix.version }}
cache: npm
- run: npm ci --no-audit --no-fund --prefer-offline
- name: Test configs expect ESLint violations
run: |
# Helper function to test that ESLint finds violations
test_config() {
local name="$1"
local path="$2"
set +e
npx eslint $path
local exit_code=$?
set -e
if [ $exit_code -eq 0 ]; then
echo "❌ $name test files should have ESLint violations but none were found"
return 1
fi
echo "✅ $name test files correctly show ESLint violations"
}
# Test all configs
test_config "Base" "test-files/test.js test-files/test.json test-files/test.yml" && \
test_config "Angular" "test-files/angular/" && \
test_config "NestJS" "test-files/nestjs/" && \
test_config "Next.js" "test-files/nextjs/" && \
test_config "Node.js" "test-files/nodejs/" && \
test_config "Preact" "test-files/preact/" && \
test_config "Web Components" "test-files/web-components/" && \
test_config "WebC" "-c test-files/webc/eslint.config.mjs test-files/webc/"