-
Notifications
You must be signed in to change notification settings - Fork 66
214 lines (185 loc) · 6.53 KB
/
tests.yml
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
name: tests
on:
push:
branches:
- master
- ci
pull_request:
jobs:
test:
# Skip tests when doing a release to avoid the workflow race
# when the release PR gets merged by the bot.
if: needs.prep.outputs.version == 0
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.edgedb-version == 'nightly' }}
strategy:
matrix:
node-version: ["18", "20", "22"]
os: [ubuntu-latest]
edgedb-version: ["stable"]
include:
- os: ubuntu-latest
node-version: "20"
edgedb-version: "nightly"
- os: ubuntu-latest
node-version: "20"
edgedb-version: "4"
- os: ubuntu-latest
node-version: "20"
edgedb-version: "3"
- os: ubuntu-latest
node-version: "20"
edgedb-version: "2"
# XXX: macOS is currently unsupported by setup-edgedb
# - os: macos-latest
# node-version: "20"
# edgedb-version: "stable"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 50
submodules: true
- name: Setup WSL
if: ${{ matrix.os == 'windows-2019' }}
uses: vampire/setup-wsl@v1
with:
wsl-shell-user: edgedb
additional-packages: ca-certificates
curl
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Set up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Install Turbo globally
run: |
yarn global add turbo
- name: Install dev deps
run: |
yarn --frozen-lockfile
- name: Lint
run: |
yarn lint
- name: Check format
run: |
yarn format
- name: Install EdgeDB
uses: edgedb/setup-edgedb@6763b6de72782d9c2e5ecc1095986a1c707da68f
with:
instance-name: test
server-version: ${{ matrix.edgedb-version }}
- name: Show actual EdgeDB server version
run: |
echo ACTIVE_EDGEDB_VERSION=$(edgedb query 'select sys::get_version_as_str()' -I test) >> $GITHUB_ENV
- name: Run package tests
run: |
yarn ci:test
- name: Run query builder integration tests legacy
if: ${{ matrix.edgedb-version == '2' }}
run: |
turbo run ci:integration-test --filter=@edgedb/integration-legacy
- name: Run query builder integration tests lts
if: ${{ matrix.edgedb-version == '3' || matrix.edgedb-version == '4' || matrix.edgedb-version == 'stable' || matrix.edgedb-version == 'nightly' }}
run: |
turbo run ci:integration-test --filter=@edgedb/integration-lts
turbo run bench:types --filter=@edgedb/integration-lts || echo "Benchmark types script failed, proceeding anyway."
- name: Run query builder integration tests stable
if: ${{ matrix.edgedb-version == 'stable' || matrix.edgedb-version == 'nightly' }}
run: |
turbo run ci:integration-test --filter=@edgedb/integration-stable
- name: Run query builder integration tests nightly
if: ${{ matrix.edgedb-version == 'nightly' }}
run: |
turbo run ci:integration-test --filter=@edgedb/integration-nightly
- name: Typecheck other packages
run: |
yarn ci:typecheck
# This job exists solely to act as the test job aggregate to be
# targeted by branch policies.
regression-tests:
name: "Regression Tests"
needs: [test]
runs-on: ubuntu-latest
steps:
- run: echo OK
test-cli-wrapper:
name: "Test CLI Wrapper"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Node 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Install dev deps
run: |
yarn --frozen-lockfile
- name: Build and pack CLI wrapper
run: |
yarn workspace edgedb run build
yarn workspace edgedb pack --filename=${{ github.workspace }}/edgedb-cli.tar.gz
- name: Test CLI wrapper with npm
run: |
mkdir ${{ runner.temp }}/temp-npm
cd ${{ runner.temp }}/temp-npm
npm init -y
npm install ${{ github.workspace }}/edgedb-cli.tar.gz
npm exec edgedb -- project init --non-interactive
npm exec edgedb -- --version
npm exec edgedb -- query 'select sys::get_version_as_str()'
- name: Test CLI wrapper with yarn
run: |
mkdir ${{ runner.temp }}/temp-yarn
cd ${{ runner.temp }}/temp-yarn
yarn init -y
yarn add ${{ github.workspace}}/edgedb-cli.tar.gz
yarn edgedb project init --non-interactive
yarn edgedb --version
yarn edgedb query 'select sys::get_version_as_str()'
- uses: threeal/setup-yarn-action@ec8c075e62bc497968de40011c2b766f5e8f1ac5
with:
version: latest
cache: false
- name: Test CLI wrapper with yarn-berry
run: |
mkdir ${{ runner.temp }}/temp-yarn-berry
cd ${{ runner.temp }}/temp-yarn-berry
yarn set version berry
yarn init -y
touch yarn.lock
yarn add ${{ github.workspace }}/edgedb-cli.tar.gz
yarn edgedb project init --non-interactive
yarn edgedb --version
yarn edgedb query 'select sys::get_version_as_str()'
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d
with:
version: latest
run_install: false
- name: Test CLI wrapper with pnpm
run: |
mkdir ${{ runner.temp }}/temp-pnpm
cd ${{ runner.temp}}/temp-pnpm
pnpm init
pnpm add ${{ github.workspace }}/edgedb-cli.tar.gz
pnpm exec edgedb project init --non-interactive
pnpm exec edgedb --version
pnpm exec edgedb query 'select sys::get_version_as_str()'
- uses: oven-sh/setup-bun@8f24390df009a496891208e5e36b8a1de1f45135
- name: Test CLI wrapper with bun
run: |
mkdir temp-bun
cd temp-bun
bun init
bun add ${{ github.workspace }}/edgedb-cli.tar.gz
bun edgedb project init --non-interactive
bun edgedb --version
bun edgedb query 'select sys::get_version_as_str()'