-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (150 loc) · 4.14 KB
/
runTests.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
name: Run Tests
on:
workflow_dispatch:
inputs:
useComplexSwagger:
description: 'use complexSwagger.json'
required: false
default: 'true'
push:
branches:
- master
pull_request:
branches: [ master ]
env:
OPENAPI_TOOLKIT_TESTFILE: "${{ github.workspace }}/.github/complexSwagger.json"
jobs:
prepare:
runs-on: ubuntu-latest
name: Prepare Environment
steps:
- name: checkout
uses: actions/checkout@v3
- name: install node
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Set useComplexSwagger conditions
id: useComplexSwagger
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.event.inputs.useComplexSwagger }}" == "true" ]]; then
echo "::set-output name=useComplexSwagger::true"
elif [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.title }}" == *"+ complex ut"* ]]; then
echo "::set-output name=useComplexSwagger::true"
else
echo "::set-output name=useComplexSwagger::false"
fi
- name: download swagger file
run: curl https://petstore.swagger.io/v2/swagger.json -o $OPENAPI_TOOLKIT_TESTFILE
if: steps.useComplexSwagger.outputs.useComplexSwagger == 'false'
- name: install dependencies
run: rm -rf .npmrc && npm i
- name: build
run: npm run build
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
test-typescript-axios:
name: Test Typescript Axios
runs-on: ubuntu-latest
needs: [ prepare ]
steps:
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- run: npm run test:typescript-axios
test-typescript-models:
name: Test Typescript Models
runs-on: ubuntu-latest
needs: [ prepare ]
steps:
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- run: npm run test:typescript-models
test-typescript-reactquery:
name: Test Typescript ReactQuery
runs-on: ubuntu-latest
needs: [ prepare ]
steps:
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- run: npm run test:typescript-react-query
test-csharp:
name: Test C#
runs-on: ubuntu-latest
needs: [ prepare ]
env:
DOTNET_NOLOGO: true
steps:
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: install dotnet
uses: actions/setup-dotnet@v3
- run: npm run test:csharp
test-csharp-nullable-false:
name: Test C# nullable false
runs-on: ubuntu-latest
needs: [ prepare ]
env:
DOTNET_NOLOGO: true
steps:
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: install dotnet
uses: actions/setup-dotnet@v3
- run: npm run test:csharp2
test-python:
name: Test Python
runs-on: ubuntu-latest
needs: [ prepare ]
steps:
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: install python
uses: actions/setup-python@v4
- run: pip install pylint requests
- run: npm run test:python
continue-on-error: true
test-go:
name: Test Go
runs-on: ubuntu-latest
needs: [ prepare ]
steps:
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- run: npm run test:go
continue-on-error: true
test-go-server:
name: Test Go Server
runs-on: ubuntu-latest
needs: [ prepare ]
steps:
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- run: npm run test:go-server
continue-on-error: true