-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
193 lines (164 loc) · 6.76 KB
/
test-pr.yaml
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
name: Test PR
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/setup
test:
needs: [build]
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: true
matrix:
fixture:
- typescript,typescript-zod,typescript-effect-schema
- javascript,schema-javascript
- golang,schema-golang
- cjson,schema-cjson
- cplusplus,schema-cplusplus
- flow,schema-flow
- java,schema-java
- python,schema-python
- haskell,schema-haskell
- csharp,schema-csharp,schema-json-csharp,graphql-csharp,csharp-SystemTextJson
- json-ts-csharp
- dart,schema-dart
- swift,schema-swift
- javascript-prop-types
- ruby
- php
- scala3,schema-scala3
- elixir,schema-elixir,graphql-elixir
# Partially working
# - schema-typescript # TODO Unify with typescript once fixed
# Implementation is too outdated to test in GitHub Actions
# - elm,schema-elm
# Language is too niche / obscure to test easily on ubuntu-latest
# - pike,schema-pike
# Not yet started
# @schani can you help me understand this fixture?
# It looks like it tests 13+ languages?
# - graphql
# Never tested?
# - crystal
runs-on: [ubuntu-latest]
include:
# Rust is very slow, so we use a larger runner
- fixture: rust,schema-rust
runs-on: ubuntu-latest-8-cores
# Kotlin is also slow
- fixture: kotlin,schema-kotlin,kotlin-jackson,schema-kotlin-jackson
runs-on: ubuntu-latest-8-cores
- fixture: objective-c
runs-on: macos-11
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: Setup Dart
if: ${{ contains(matrix.fixture, 'dart') }}
uses: dart-lang/[email protected]
with:
sdk: 2.14.4
- name: Setup Swift
if: ${{ contains(matrix.fixture, 'swift') }}
uses: swift-actions/setup-swift@v1
with:
swift-version: "5.7.2"
- 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: 6
- 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.1/binary-for-linux-64-bit.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.7
if: ${{ contains(matrix.fixture, 'python') }}
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install Python Dependencies
if: ${{ contains(matrix.fixture, 'python') }}
run: |
pip3.7 install mypy python-dateutil types-python-dateutil
- name: Install flow
if: ${{ contains(matrix.fixture, 'flow') }}
run: |
npm install -g [email protected] [email protected]
- 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/[email protected]
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@main
- run: echo '@main def hello() = println("We need this spam print statement for bloop to exit correctly...")' | 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 test
test-complete:
needs: test
runs-on: ubuntu-latest
steps:
- run: echo 🎉