forked from swagger-api/swagger-codegen
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (109 loc) · 3.43 KB
/
test-framework.yml
File metadata and controls
125 lines (109 loc) · 3.43 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
name: Test Framework
on:
# execute on demand
workflow_dispatch:
branches: ["master", "test-framework", "3.0.0"]
jobs:
# builds codegen cli and uploads its artifact
build-codegen:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8 ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: build codegen
run: |
mvn -q -B package -DskipTests
- name: prepare codegen cli
run: mkdir codegen-cli && cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli
- name: upload codegen cli
uses: actions/upload-artifact@v2
with:
name: codegen-cli
path: codegen-cli
# generate a javascript client V3 from petstore3.swagger.io OpenAPI definition
generate-js-v3-petstore:
needs: build-codegen
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8 ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Download codegen cli
uses: actions/download-artifact@v2
with:
name: codegen-cli
- name: generate
id: generate
continue-on-error: true
uses: ./.github/actions/generate
with:
language: $LANGUAGE
job-name: ${JOB_NAME}
options: $OPTIONS
- name: upload generate logs
uses: actions/upload-artifact@v2
with:
name: generate_logs_${{ env.JOB_NAME }}
path: ${{ steps.generate.outputs.logs }}
- name: upload generated code
if: contains(steps.generate.outcome, 'success')
uses: actions/upload-artifact@v2
with:
name: generated_${{ env.JOB_NAME }}
path: ${{ steps.generate.outputs.path }}
- run: |
echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }}
- name: upload generate outcome
uses: actions/upload-artifact@v2
with:
name: generate_outcome_${{ env.JOB_NAME }}
path: generate_outcome_${{ env.JOB_NAME }}
env:
LANGUAGE: "javascript"
JOB_NAME: "js-petstore-v3"
OPTIONS: " -DappName=PetstoreClient --additional-properties useES6=false"
build-js-v3-petstore:
needs: generate-js-v3-petstore
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: generated_${{ env.JOB_NAME }}
# todo replace with job output
path: generated/${{ env.JOB_NAME }}
- name: Download logs
uses: actions/download-artifact@v2
with:
name: generate_logs_${{ env.JOB_NAME }}
#path: ${{ env.JOB_NAME }}.build.log
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: jsbuild
id: jsbuild
uses: ./.github/actions/jsbuild
with:
path: generated/${{ env.JOB_NAME }}
job-name: ${{ env.JOB_NAME }}
- name: upload logs
uses: actions/upload-artifact@v2
with:
name: ${{ steps.jsbuild.outputs.logs }}
path: ${{ steps.jsbuild.outputs.logs }}
env:
JOB_NAME: "js-petstore-v3"