-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (83 loc) · 2.67 KB
/
Copy pathci.yml
File metadata and controls
105 lines (83 loc) · 2.67 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
name: CI
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
runs-on: blacksmith-2vcpu-ubuntu-2404
strategy:
matrix:
node-version: [22, 24]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- uses: pnpm/action-setup@ac6db6d3c1f721f886538a378a2d73e85697340a # v6
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Run npm audit
run: pnpm audit --audit-level=moderate
continue-on-error: true
- name: Verify npm package contents
run: |
for pkg in packages/*; do
[ -f "$pkg/package.json" ] || continue
name="$(basename "$pkg")"
if ! (cd "$pkg" && npm pack --dry-run) >/tmp/"$name"-pack.txt 2>&1; then
echo "::error::npm pack failed for $pkg"
cat /tmp/"$name"-pack.txt
exit 1
fi
if grep -E 'src/__tests__|src/.*\.test\.ts|fixtures/' /tmp/"$name"-pack.txt; then
echo "::error::Unexpected test/source fixture content in package $pkg"
cat /tmp/"$name"-pack.txt
exit 1
fi
done
- run: pnpm test
- name: Run coverage
run: pnpm test:coverage
- name: Upload coverage reports
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: matrix.node-version == 22
with:
name: coverage-reports
path: |
packages/*/coverage/
retention-days: 14
adversarial-ci:
runs-on: blacksmith-2vcpu-ubuntu-2404
needs: build-and-test
strategy:
matrix:
node-version: [22, 24]
permissions:
contents: read
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- uses: pnpm/action-setup@ac6db6d3c1f721f886538a378a2d73e85697340a # v6
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Run adversarial fixture corpus
run: pnpm --filter=@dialectos/cli test:adversarial