-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
217 lines (190 loc) · 8.35 KB
/
Copy pathtest-pr.yaml
File metadata and controls
217 lines (190 loc) · 8.35 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
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
215
216
217
name: Test
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build and unit tests (Node ${{ matrix.node-version }})
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
node-version: ["20", "22", "24"]
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/setup
with:
node-version: ${{ matrix.node-version }}
- name: Check formatting (Biome)
if: ${{ matrix.node-version == '24' }}
run: npm run lint
- run: npm run test:unit
- run: node dist/index.js --version
- name: Run representative fixtures on the minimum Node version
if: ${{ matrix.node-version == '20' }}
run: CPUs=2 QUICKTEST=true FIXTURE=javascript,typescript npm run test:fixtures -- test/inputs/json/samples/pokedex.json
test:
needs: [build]
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: true
matrix:
fixture:
- typescript,schema-typescript,typescript-zod,schema-typescript-zod,typescript-effect-schema,schema-typescript-effect-schema
- javascript,schema-javascript
- golang,schema-golang
- cjson,schema-cjson
- cjson-default,cjson-multi-header,cjson-multi-split
- cplusplus,schema-cplusplus
- flow,schema-flow
- java,schema-java
- python,schema-python
- haskell,schema-haskell
- csharp,schema-csharp,csharp-records,schema-csharp-records,schema-json-csharp,graphql-csharp,csharp-SystemTextJson,schema-csharp-SystemTextJson
- json-ts-csharp
- dart,schema-dart
- javascript-prop-types,schema-javascript-prop-types
- ruby,schema-ruby-syntax
- php,schema-php
- crystal,schema-crystal
- scala3,schema-scala3
- scala3-upickle,schema-scala3-upickle
- elixir,schema-elixir,graphql-elixir
- elm,schema-elm
- comment-injection-treesitter,comment-injection-typescript,comment-injection-typescript-zod,comment-injection-typescript-effect-schema
# Not yet started
# @schani can you help me understand this fixture?
# It looks like it tests 13+ languages?
# - graphql
runs-on: [ubuntu-22.04]
include:
# Rust is very slow, so we use a larger runner
- fixture: rust,schema-rust
runs-on: ubuntu-latest-16-cores
# Kotlin is also slow
- fixture: kotlin,schema-kotlin,kotlin-jackson,schema-kotlin-jackson
runs-on: ubuntu-latest-16-cores
- fixture: kotlinx,schema-kotlinx
runs-on: ubuntu-latest-16-cores
- fixture: pike,schema-pike
runs-on: ubuntu-24.04
- fixture: swift,schema-swift
runs-on: macos-latest
- fixture: objective-c,schema-objective-c,comment-injection-objective-c
runs-on: macos-latest
name: ${{ matrix.fixture }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/setup
- name: Setup PHP
if: ${{ contains(matrix.fixture, 'php') }}
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
- name: Install Pike
if: ${{ contains(matrix.fixture, 'pike') }}
run: |
sudo apt-get update
sudo apt-get install -y pike8.0-core
- name: Setup Crystal
if: ${{ contains(matrix.fixture, 'crystal') }}
uses: crystal-lang/install-crystal@v1
- name: Setup Dart
if: ${{ contains(matrix.fixture, 'dart') }}
uses: dart-lang/setup-dart@v1.3
with:
sdk: 2.14.4
- name: Install Ruby
uses: ruby/setup-ruby@v1
if: ${{ contains(matrix.fixture, 'ruby') }}
with:
ruby-version: "3.2.0"
- name: Setup .NET Core SDK
if: ${{ contains(matrix.fixture, 'csharp') }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8
- name: Install Rust
if: ${{ contains(matrix.fixture, 'rust') }}
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Elm
if: ${{ contains(matrix.fixture, 'elm') }}
run: |
curl -L -o elm.gz https://github.com/elm/compiler/releases/download/0.19.2/elm-0.19.2-linux-x64.gz
gunzip elm.gz
chmod +x elm
sudo mv elm /usr/local/bin/
- name: Install Haskell
if: ${{ contains(matrix.fixture, 'haskell') }}
run: |
if ! command -v stack > /dev/null 2>&1; then
curl -sL "https://get.haskellstack.org/" | sh
fi
- name: Install Python 3.12
if: ${{ contains(matrix.fixture, 'python') }}
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install Python Dependencies
if: ${{ contains(matrix.fixture, 'python') }}
run: |
pip3.12 install mypy python-dateutil types-python-dateutil
- name: Install flow
if: ${{ contains(matrix.fixture, 'flow') }}
run: |
npm install -g flow-bin@0.66.0 flow-remove-types@1.2.3
- name: Install Java
if: ${{ matrix.fixture == 'java,schema-java' || contains(matrix.fixture, 'kotlin') }}
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "adopt"
- name: Install Maven
if: ${{ matrix.fixture == 'java,schema-java' }}
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.8.2
- name: Install Kotlin
if: ${{ contains(matrix.fixture, 'kotlin') }}
uses: fwilhe2/setup-kotlin@main
- name: Install go
if: ${{ contains(matrix.fixture, 'golang') }}
uses: actions/setup-go@v3
with:
go-version: 1.15
- name: Install C
if: ${{ contains(matrix.fixture, 'cjson') }}
run: |
sudo apt-get update
sudo apt-get -y install build-essential valgrind
- name: Install C++
if: ${{ contains(matrix.fixture, 'cplusplus') }}
run: |
sudo apt-get update
sudo apt-get -y install libboost-all-dev software-properties-common g++ --assume-yes
- name: Install scala
if: ${{ contains(matrix.fixture, 'scala3') }}
uses: VirtusLab/scala-cli-setup@v1.15.0
- run: echo '@main def hello() = println("Warm up the Scala compilation server")' | SCALA_CLI_EXTRA_TIMEOUT=2min scala-cli _
if: ${{ contains(matrix.fixture, 'scala3') }}
- name: Install Elixir
if: ${{ contains(matrix.fixture, 'elixir') }}
uses: erlef/setup-beam@v1
with:
elixir-version: "1.15.7"
otp-version: "26.0"
- run: QUICKTEST=true FIXTURE=${{ matrix.fixture }} npm run test:fixtures
env:
CPUs: ${{ contains(matrix.fixture, 'scala3') && '2' || '0' }}
test-complete:
if: ${{ cancelled() || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'failure') }}
needs: test
runs-on: ubuntu-22.04
steps:
- run: |
echo "Some workflows have failed!"
exit 1