Repository navigation
127 lines (121 loc) · 3.99 KB
/
Copy pathci.yml
File metadata and controls
127 lines (121 loc) · 3.99 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
116
117
118
119
120
121
122
123
124
125
126
127
name: ci
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
build-and-test:
name: Build + Test (Node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [20, 22]
steps:
- uses: actions/checkout@v7
- name: Checkout maps repo
uses: actions/checkout@v7
with:
repository: interscript/maps
path: _maps
- name: Symlink maps into ../maps
run: ln -s "$PWD/_maps" "$GITHUB_WORKSPACE/../maps"
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npm run build
- run: npm test
- run: npm run lint
- run: npm run format:check
isc-parity:
name: ISC parser parity (all 289 maps)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Checkout maps repo
uses: actions/checkout@v7
with:
repository: interscript/maps
path: _maps
- name: Symlink maps into ../maps
run: ln -s "$PWD/_maps" "$GITHUB_WORKSPACE/../maps"
- uses: actions/setup-node@v7
with:
node-version: "22"
cache: npm
- run: npm ci
- run: npm run build
- name: Parse all .isc files
run: npx tsx scripts/parse-all-isc.ts
- name: End-to-end parity (target 100%)
run: npx vitest run test/isc/end-to-end.test.ts
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Checkout maps repo
uses: actions/checkout@v7
with:
repository: interscript/maps
path: _maps
- name: Symlink maps into ../maps
run: ln -s "$PWD/_maps" "$GITHUB_WORKSPACE/../maps"
- uses: actions/setup-node@v7
with:
node-version: "22"
cache: npm
- run: npm ci
- run: npm run build
- run: npm test -- --coverage
- uses: actions/upload-artifact@v7
with:
name: coverage-report
path: coverage/
conformance-matrix:
name: Conformance matrix (frozen fixtures)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
- run: npm ci
- name: Download fixtures (Releases via the API -- bypasses the asset-redirect CDN, which served stale entries after the WO79 republish)
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir -p fixtures && cd fixtures
dl() { # dl <tag> <asset-name> <out>
local id
id=$(gh api repos/interscript/interscript-models/releases/tags/$1 --jq ".assets[] | select(.name==\"$2\") | .id")
echo "dl $1 / $2 -> asset id: '$id'"
if [ -z "$id" ]; then echo "ASSET NOT FOUND: $2 on $1"; return 1; fi
gh api -H "Accept: application/octet-stream" repos/interscript/interscript-models/releases/assets/$id > "$3"
}
dl index-v12 models-index.yaml models-index.yaml
dl index-v12 models-index.yaml.sha256 models-index.yaml.sha256
sha256sum -c models-index.yaml.sha256
for v in urd-diac-base fas-diac-base urd-g2p-base; do
dl index-v12 $v-vectors.json $v-vectors.json
done
# the two single-zip models; urd-g2p (split parts) resolves
# via the runtime resolver in a later matrix pass
for m in urd-diac-base-1.0 fas-diac-base-1.0; do
dl $m $m-fp16.zip $m.zip
done
- name: Run the matrix
run: |
for pair in "urd-diac-base-1.0 urd-diac-base" "fas-diac-base-1.0 fas-diac-base"; do
set -- $pair
echo "::group::$1"
SECRYST_E2E_ZIP="$PWD/fixtures/$1.zip" \
CONFORMANCE_VECTORS="$PWD/fixtures/$2-vectors.json" \
npx vitest run test/conformance.test.ts
echo "::endgroup::"
done