-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (145 loc) · 5.74 KB
/
Copy pathci.yml
File metadata and controls
178 lines (145 loc) · 5.74 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: ci
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
lint:
name: lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
# lint:haskell runs hlint via `stack exec --package hlint`, so the lint job needs the same
# stack toolchain and caches as the test job.
- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: "9.6.7"
enable-stack: true
stack-version: "3.7.1"
- name: Resolve cache key inputs
id: cache-key
shell: bash
run: |
echo "snapshot=$(grep '^snapshot:' stack.yaml | awk '{print $2}')" >> "$GITHUB_OUTPUT"
- name: Cache ~/.stack
uses: actions/cache@v4
with:
path: ${{ steps.setup.outputs.stack-root }}
key: ${{ runner.os }}-stack-v2-${{ steps.cache-key.outputs.snapshot }}-${{ hashFiles('stack.yaml', 'stack.yaml.lock', 'haskell/**/package.yaml') }}
restore-keys: |
${{ runner.os }}-stack-v2-${{ steps.cache-key.outputs.snapshot }}-
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
- uses: pnpm/action-setup@v4
- name: pnpm install
run: pnpm install --frozen-lockfile
- name: pnpm typecheck
run: pnpm run typecheck
- name: pnpm lint
run: pnpm run lint
test:
name: test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: "9.6.7"
enable-stack: true
stack-version: "3.7.1"
- name: Resolve cache key inputs
id: cache-key
shell: bash
run: |
echo "snapshot=$(grep '^snapshot:' stack.yaml | awk '{print $2}')" >> "$GITHUB_OUTPUT"
- name: Cache ~/.stack
uses: actions/cache@v4
with:
path: ${{ steps.setup.outputs.stack-root }}
key: ${{ runner.os }}-stack-v2-${{ steps.cache-key.outputs.snapshot }}-${{ hashFiles('stack.yaml', 'stack.yaml.lock', 'haskell/**/package.yaml') }}
restore-keys: |
${{ runner.os }}-stack-v2-${{ steps.cache-key.outputs.snapshot }}-
- name: Cache .stack-work
uses: actions/cache@v4
with:
path: |
.stack-work
haskell/*/.stack-work
key: ${{ runner.os }}-stackwork-v2-${{ steps.cache-key.outputs.snapshot }}-${{ hashFiles('haskell/**/*.hs', 'haskell/**/package.yaml') }}
restore-keys: |
${{ runner.os }}-stackwork-v2-${{ steps.cache-key.outputs.snapshot }}-
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
- uses: pnpm/action-setup@v4
- name: pnpm install
run: pnpm install --frozen-lockfile
- name: Build (Haskell)
run: stack build --fast
- name: Build (TypeScript)
run: pnpm -r run build
- name: Test
run: pnpm run test
# The published npm CLI (@katari-lang/cli) is a Node shim with no unit coverage: it packs, then
# resolves the stack-built binary out of a staged @katari-lang/cli-<platform> package and runs
# `katari --version` / `--help` through it. Reuses this job's already-built binary.
- name: npm CLI post-pack smoke
run: node scripts/smoke-npm-cli.mjs
e2e:
name: e2e
# The wire-compatibility net between the Haskell compiler's IR/schema output and the TypeScript
# runtime (see e2e/README.md). It is heavy — a stack build plus a dockerized postgres + s3mock —
# so it runs on main pushes and manual dispatch, not on every PR.
if: github.event_name != 'pull_request'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: "9.6.7"
enable-stack: true
stack-version: "3.7.1"
- name: Resolve cache key inputs
id: cache-key
shell: bash
run: |
echo "snapshot=$(grep '^snapshot:' stack.yaml | awk '{print $2}')" >> "$GITHUB_OUTPUT"
- name: Cache ~/.stack
uses: actions/cache@v4
with:
path: ${{ steps.setup.outputs.stack-root }}
key: ${{ runner.os }}-stack-v2-${{ steps.cache-key.outputs.snapshot }}-${{ hashFiles('stack.yaml', 'stack.yaml.lock', 'haskell/**/package.yaml') }}
restore-keys: |
${{ runner.os }}-stack-v2-${{ steps.cache-key.outputs.snapshot }}-
- name: Cache .stack-work
uses: actions/cache@v4
with:
path: |
.stack-work
haskell/*/.stack-work
key: ${{ runner.os }}-stackwork-v2-${{ steps.cache-key.outputs.snapshot }}-${{ hashFiles('haskell/**/*.hs', 'haskell/**/package.yaml') }}
restore-keys: |
${{ runner.os }}-stackwork-v2-${{ steps.cache-key.outputs.snapshot }}-
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
- uses: pnpm/action-setup@v4
- name: pnpm install
run: pnpm install --frozen-lockfile
# The suite resolves the CLI via `stack path --local-install-root`, so the katari executable must
# exist. It boots the runtime from source (tsx) and builds the sidecar bundler itself, so no
# TypeScript build step is needed here — only the compiled CLI binary.
- name: Build the katari CLI
run: stack build --fast katari-cli:katari
# The suite brings up its own compose services (postgres + s3mock) and provisions an isolated
# database and bucket, so no `services:` block or extra setup is required — docker is preinstalled
# on the GitHub-hosted runner.
- name: e2e
run: pnpm run test:e2e