-
-
Notifications
You must be signed in to change notification settings - Fork 0
217 lines (217 loc) · 6.66 KB
/
integration.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
215
216
217
name: Integration
on:
- pull_request
- push
jobs:
csharp:
name: CSharp
runs-on: ubuntu-latest
services:
mock:
image: mockserver/mockserver
ports:
- 1080:1080
defaults:
run:
working-directory: integration/csharp
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core SDK 8.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Init mockserver
run: "curl -X PUT http://127.0.0.1:1080/mockserver/expectation -H 'Content-Type: application/json' -d @./../../mockserver/initializerJson.json"
- name: Move sdkgen.json file
run: mv ./sdkgen.json ../../input/
- name: Generate
working-directory: .
env:
SDKGEN_CLIENT_ID: ${{ secrets.SDKGEN_CLIENT_ID }}
SDKGEN_CLIENT_SECRET: ${{ secrets.SDKGEN_CLIENT_SECRET }}
run: docker compose up
- name: Move
working-directory: .
run: cp ./output/*.cs ./integration/csharp/
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Run
run: bin/Release/net8.0/generator
go:
name: Go
runs-on: ubuntu-latest
services:
mock:
image: mockserver/mockserver
ports:
- 1080:1080
defaults:
run:
working-directory: integration/go
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Init mockserver
run: "curl -X PUT http://127.0.0.1:1080/mockserver/expectation -H 'Content-Type: application/json' -d @./../../mockserver/initializerJson.json"
- name: Move sdkgen.json file
run: mv ./sdkgen.json ../../input/
- name: Generate
working-directory: .
env:
SDKGEN_CLIENT_ID: ${{ secrets.SDKGEN_CLIENT_ID }}
SDKGEN_CLIENT_SECRET: ${{ secrets.SDKGEN_CLIENT_SECRET }}
run: docker compose up
- name: Move
working-directory: .
run: cp ./output/*.go ./integration/go/
- name: Build
run: go build -v
- name: Run
run: ./main
java:
name: Java
runs-on: ubuntu-latest
services:
mock:
image: mockserver/mockserver
ports:
- 1080:1080
defaults:
run:
working-directory: integration/java
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Init mockserver
run: "curl -X PUT http://127.0.0.1:1080/mockserver/expectation -H 'Content-Type: application/json' -d @./../../mockserver/initializerJson.json"
- name: Move sdkgen.json file
run: mv ./sdkgen.json ../../input/
- name: Generate
working-directory: .
env:
SDKGEN_CLIENT_ID: ${{ secrets.SDKGEN_CLIENT_ID }}
SDKGEN_CLIENT_SECRET: ${{ secrets.SDKGEN_CLIENT_SECRET }}
run: docker compose up
- name: Move
working-directory: .
run: cp ./output/*.java ./integration/java/
- name: Build with Maven
run: mvn --batch-mode --update-snapshots package
- name: Run
run: java -jar target/generator-0.1.0-jar-with-dependencies.jar
php:
name: PHP
runs-on: ubuntu-latest
services:
mock:
image: mockserver/mockserver
ports:
- 1080:1080
defaults:
run:
working-directory: integration/php
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none
- name: Init mockserver
run: "curl -X PUT http://127.0.0.1:1080/mockserver/expectation -H 'Content-Type: application/json' -d @./../../mockserver/initializerJson.json"
- name: Move sdkgen.json file
run: mv ./sdkgen.json ../../input/
- name: Generate
working-directory: .
env:
SDKGEN_CLIENT_ID: ${{ secrets.SDKGEN_CLIENT_ID }}
SDKGEN_CLIENT_SECRET: ${{ secrets.SDKGEN_CLIENT_SECRET }}
run: docker compose up
- name: Move
working-directory: .
run: cp ./output/*.php ./integration/php/
- name: Composer install
run: composer install --no-interaction --no-ansi --no-progress
- name: Run
run: php main.php
python:
name: Python
runs-on: ubuntu-latest
services:
mock:
image: mockserver/mockserver
ports:
- 1080:1080
defaults:
run:
working-directory: integration/python
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Init mockserver
run: "curl -X PUT http://127.0.0.1:1080/mockserver/expectation -H 'Content-Type: application/json' -d @./../../mockserver/initializerJson.json"
- name: Move sdkgen.json file
run: mv ./sdkgen.json ../../input/
- name: Generate
working-directory: .
env:
SDKGEN_CLIENT_ID: ${{ secrets.SDKGEN_CLIENT_ID }}
SDKGEN_CLIENT_SECRET: ${{ secrets.SDKGEN_CLIENT_SECRET }}
run: docker compose up
- name: Create sdk dir
run: mkdir sdk
- name: Move
working-directory: .
run: cp ./output/*.py ./integration/python/sdk
- name: PIP install
run: pip install -r requirements.txt
- name: Run
run: python main.py
typescript:
name: TypeScript
runs-on: ubuntu-latest
services:
mock:
image: mockserver/mockserver
ports:
- 1080:1080
defaults:
run:
working-directory: integration/typescript
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Init mockserver
run: "curl -X PUT http://127.0.0.1:1080/mockserver/expectation -H 'Content-Type: application/json' -d @./../../mockserver/initializerJson.json"
- name: Move sdkgen.json file
run: mv ./sdkgen.json ../../input/
- name: Generate
working-directory: .
env:
SDKGEN_CLIENT_ID: ${{ secrets.SDKGEN_CLIENT_ID }}
SDKGEN_CLIENT_SECRET: ${{ secrets.SDKGEN_CLIENT_SECRET }}
run: docker compose up
- name: Create sdk dir
run: mkdir sdk
- name: Move
working-directory: .
run: cp ./output/*.ts ./integration/typescript
- run: npm install
- run: npm run build
- name: Run
run: cd dist && node main.js