Skip to content

Commit 89b0bc4

Browse files
authored
Add workflow to test TypeScript clients (#22126)
* add workflow to test ts clients * update * update * run petstore * update * trigger build
1 parent 0b9172e commit 89b0bc4

File tree

5 files changed

+247
-45
lines changed

5 files changed

+247
-45
lines changed
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
name: Samples TS clients
2+
3+
on:
4+
push:
5+
paths:
6+
- samples/client/others/typescript-angular/**
7+
# comment out angular released before Nov 2023
8+
#- samples/client/petstore/typescript-angular-v12-provided-in-root/**
9+
#- samples/client/petstore/typescript-angular-v13-provided-in-root/**
10+
#- samples/client/petstore/typescript-angular-v14-provided-in-root/**
11+
#- samples/client/petstore/typescript-angular-v15-provided-in-root/**
12+
#- samples/client/petstore/typescript-angular-v16-provided-in-root/**
13+
# comment out below as there's no pom.xml
14+
#- samples/client/petstore/typescript-angular-v17-provided-in-root/**
15+
#- samples/client/petstore/typescript-angular-v18-provided-in-root/**
16+
#- samples/client/petstore/typescript-angular-v19-provided-in-root/**
17+
- samples/openapi3/client/petstore/typescript/builds/default/**
18+
# comment out due to build failure
19+
#- samples/openapi3/client/petstore/typescript/tests/default/**
20+
- samples/openapi3/client/petstore/typescript/builds/jquery/**
21+
# comment out due to build failure
22+
#- samples/openapi3/client/petstore/typescript/tests/jquery/**
23+
- samples/openapi3/client/petstore/typescript/builds/object_params/**
24+
# comment out due to build failure
25+
#- samples/openapi3/client/petstore/typescript/tests/object_params/**
26+
#- samples/openapi3/client/petstore/typescript/builds/inversify/**
27+
#- samples/openapi3/client/petstore/typescript/tests/inversify/**
28+
#- samples/openapi3/client/petstore/typescript/tests/deno/**
29+
- samples/openapi3/client/petstore/typescript/builds/browser/**
30+
# comment out due to build failure
31+
#- samples/openapi3/client/petstore/typescript/tests/browser/**
32+
#- samples/openapi3/client/petstore/typescript/builds/nullable-enum/**
33+
- samples/client/petstore/typescript-fetch/builds/default/**
34+
- samples/client/petstore/typescript-fetch/builds/es6-target/**
35+
- samples/client/petstore/typescript-fetch/builds/with-npm-version/**
36+
- samples/client/petstore/typescript-fetch/tests/default/**
37+
# comment out due to build failure
38+
#- samples/client/petstore/typescript-node/npm/**
39+
- samples/client/petstore/typescript-rxjs/builds/with-npm-version/**
40+
- samples/client/petstore/typescript-axios/builds/with-npm-version/**
41+
# comment out due to build failure
42+
#- samples/client/petstore/typescript-axios/tests/default/**
43+
pull_request:
44+
paths:
45+
- samples/client/others/typescript-angular/**
46+
#- samples/client/petstore/typescript-angular-v12-provided-in-root/**
47+
#- samples/client/petstore/typescript-angular-v13-provided-in-root/**
48+
#- samples/client/petstore/typescript-angular-v14-provided-in-root/**
49+
#- samples/client/petstore/typescript-angular-v15-provided-in-root/**
50+
#- samples/client/petstore/typescript-angular-v16-provided-in-root/**
51+
#- samples/client/petstore/typescript-angular-v17-provided-in-root/**
52+
#- samples/client/petstore/typescript-angular-v18-provided-in-root/**
53+
#- samples/client/petstore/typescript-angular-v19-provided-in-root/**
54+
- samples/openapi3/client/petstore/typescript/builds/default/**
55+
#- samples/openapi3/client/petstore/typescript/tests/default/**
56+
- samples/openapi3/client/petstore/typescript/builds/jquery/**
57+
#- samples/openapi3/client/petstore/typescript/tests/jquery/**
58+
- samples/openapi3/client/petstore/typescript/builds/object_params/**
59+
#- samples/openapi3/client/petstore/typescript/tests/object_params/**
60+
#- samples/openapi3/client/petstore/typescript/builds/inversify/**
61+
#- samples/openapi3/client/petstore/typescript/tests/inversify/**
62+
#- samples/openapi3/client/petstore/typescript/tests/deno/**
63+
- samples/openapi3/client/petstore/typescript/builds/browser/**
64+
#- samples/openapi3/client/petstore/typescript/tests/browser/**
65+
#- samples/openapi3/client/petstore/typescript/builds/nullable-enum/**
66+
- samples/client/petstore/typescript-fetch/builds/default/**
67+
- samples/client/petstore/typescript-fetch/builds/es6-target/**
68+
- samples/client/petstore/typescript-fetch/builds/with-npm-version/**
69+
- samples/client/petstore/typescript-fetch/tests/default/**
70+
#- samples/client/petstore/typescript-node/npm/**
71+
- samples/client/petstore/typescript-rxjs/builds/with-npm-version/**
72+
- samples/client/petstore/typescript-axios/builds/with-npm-version/**
73+
#- samples/client/petstore/typescript-axios/tests/default/**
74+
jobs:
75+
build:
76+
name: Build projects
77+
runs-on: ubuntu-latest
78+
services:
79+
petstore-api:
80+
image: swaggerapi/petstore
81+
ports:
82+
- 80:8080
83+
env:
84+
SWAGGER_HOST: http://petstore.swagger.io
85+
SWAGGER_BASE_PATH: /v2
86+
strategy:
87+
fail-fast: false
88+
matrix:
89+
node:
90+
#- "18.x"
91+
- "20.x"
92+
sample:
93+
- samples/client/others/typescript-angular/
94+
#- samples/client/petstore/typescript-angular-v12-provided-in-root/
95+
#- samples/client/petstore/typescript-angular-v13-provided-in-root/
96+
#- samples/client/petstore/typescript-angular-v14-provided-in-root/
97+
#- samples/client/petstore/typescript-angular-v15-provided-in-root/
98+
#- samples/client/petstore/typescript-angular-v16-provided-in-root/
99+
#- samples/client/petstore/typescript-angular-v17-provided-in-root/
100+
#- samples/client/petstore/typescript-angular-v18-provided-in-root/
101+
#- samples/client/petstore/typescript-angular-v19-provided-in-root/
102+
- samples/openapi3/client/petstore/typescript/builds/default/
103+
#- samples/openapi3/client/petstore/typescript/tests/default/
104+
- samples/openapi3/client/petstore/typescript/builds/jquery/
105+
#- samples/openapi3/client/petstore/typescript/tests/jquery/
106+
- samples/openapi3/client/petstore/typescript/builds/object_params/
107+
#- samples/openapi3/client/petstore/typescript/tests/object_params/
108+
#- samples/openapi3/client/petstore/typescript/builds/inversify/
109+
#- samples/openapi3/client/petstore/typescript/tests/inversify/
110+
#- samples/openapi3/client/petstore/typescript/tests/deno/
111+
- samples/openapi3/client/petstore/typescript/builds/browser/
112+
#- samples/openapi3/client/petstore/typescript/tests/browser/
113+
#- samples/openapi3/client/petstore/typescript/builds/nullable-enum/
114+
- samples/client/petstore/typescript-fetch/builds/default/
115+
- samples/client/petstore/typescript-fetch/builds/es6-target/
116+
- samples/client/petstore/typescript-fetch/builds/with-npm-version/
117+
- samples/client/petstore/typescript-fetch/tests/default/
118+
#- samples/client/petstore/typescript-node/npm/
119+
- samples/client/petstore/typescript-rxjs/builds/with-npm-version/
120+
- samples/client/petstore/typescript-axios/builds/with-npm-version/
121+
#- samples/client/petstore/typescript-axios/tests/default/
122+
steps:
123+
- uses: actions/checkout@v5
124+
- name: Add hosts to /etc/hosts
125+
run: |
126+
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
127+
- name: Set up JDK 17
128+
uses: actions/setup-java@v4
129+
with:
130+
java-version: '17' # Specify your desired Java version
131+
distribution: 'temurin' # Or 'adopt', 'oracle', etc.
132+
cache: maven # Cache Maven dependencies for faster builds
133+
- name: Use Node.js
134+
uses: actions/setup-node@v5
135+
with:
136+
node-version: ${{ matrix.node }}
137+
cache: 'npm' # Or 'yarn'
138+
- name: mvn integration-test
139+
working-directory: ${{ matrix.sample }}
140+
run: mvn integration-test

CI/circle_parallel.sh

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -62,51 +62,51 @@ elif [ "$NODE_INDEX" = "3" ]; then
6262

6363
echo "Running node $NODE_INDEX ... "
6464

65-
# Install node@stable (for angular 6)
66-
set +e
67-
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
68-
export NVM_DIR="/opt/circleci/.nvm"
69-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
70-
#nvm install stable
71-
# install v16 instead of the latest stable version
72-
nvm install 18
73-
nvm alias default 18
74-
node --version
75-
76-
# Each step uses the same `$BASH_ENV`, so need to modify it
77-
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
78-
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
79-
80-
(cd samples/client/others/typescript-angular && mvn integration-test)
81-
(cd samples/client/petstore/typescript-angular-v12-provided-in-root && mvn integration-test)
82-
(cd samples/client/petstore/typescript-angular-v13-provided-in-root && mvn integration-test)
83-
(cd samples/client/petstore/typescript-angular-v14-provided-in-root && mvn integration-test)
84-
(cd samples/client/petstore/typescript-angular-v15-provided-in-root && mvn integration-test)
85-
(cd samples/client/petstore/typescript-angular-v16-provided-in-root && mvn integration-test)
86-
(cd samples/client/petstore/typescript-angular-v17-provided-in-root && mvn integration-test)
87-
(cd samples/client/petstore/typescript-angular-v18-provided-in-root && mvn integration-test)
88-
(cd samples/client/petstore/typescript-angular-v19-provided-in-root && mvn integration-test)
89-
(cd samples/openapi3/client/petstore/typescript/builds/default && mvn integration-test)
90-
(cd samples/openapi3/client/petstore/typescript/tests/default && mvn integration-test)
91-
(cd samples/openapi3/client/petstore/typescript/builds/jquery && mvn integration-test)
92-
(cd samples/openapi3/client/petstore/typescript/tests/jquery && mvn integration-test)
93-
(cd samples/openapi3/client/petstore/typescript/builds/object_params && mvn integration-test)
94-
(cd samples/openapi3/client/petstore/typescript/tests/object_params && mvn integration-test)
95-
(cd samples/openapi3/client/petstore/typescript/builds/inversify && mvn integration-test)
96-
(cd samples/openapi3/client/petstore/typescript/tests/inversify && mvn integration-test)
97-
#(cd samples/openapi3/client/petstore/typescript/tests/deno && mvn integration-test)
98-
(cd samples/openapi3/client/petstore/typescript/builds/browser && mvn integration-test)
99-
(cd samples/openapi3/client/petstore/typescript/tests/browser && mvn integration-test)
100-
(cd samples/openapi3/client/petstore/typescript/builds/nullable-enum && mvn integration-test)
101-
(cd samples/client/petstore/typescript-fetch/builds/default && mvn integration-test)
102-
(cd samples/client/petstore/typescript-fetch/builds/es6-target && mvn integration-test)
103-
(cd samples/client/petstore/typescript-fetch/builds/with-npm-version && mvn integration-test)
104-
(cd samples/client/petstore/typescript-fetch/tests/default && mvn integration-test)
105-
(cd samples/client/petstore/typescript-node/npm && mvn integration-test)
106-
(cd samples/client/petstore/typescript-rxjs/builds/with-npm-version && mvn integration-test)
107-
(cd samples/client/petstore/typescript-axios/builds/with-npm-version && mvn integration-test)
108-
(cd samples/client/petstore/typescript-axios/tests/default && mvn integration-test)
109-
(cd samples/client/petstore/typescript-axios/tests/with-complex-headers && mvn integration-test)
65+
## Install node@stable (for angular 6)
66+
#set +e
67+
#curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
68+
#export NVM_DIR="/opt/circleci/.nvm"
69+
#[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
70+
##nvm install stable
71+
## install v16 instead of the latest stable version
72+
#nvm install 18
73+
#nvm alias default 18
74+
#node --version
75+
76+
## Each step uses the same `$BASH_ENV`, so need to modify it
77+
#echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
78+
#echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
79+
80+
#(cd samples/client/others/typescript-angular && mvn integration-test)
81+
#(cd samples/client/petstore/typescript-angular-v12-provided-in-root && mvn integration-test)
82+
#(cd samples/client/petstore/typescript-angular-v13-provided-in-root && mvn integration-test)
83+
#(cd samples/client/petstore/typescript-angular-v14-provided-in-root && mvn integration-test)
84+
#(cd samples/client/petstore/typescript-angular-v15-provided-in-root && mvn integration-test)
85+
#(cd samples/client/petstore/typescript-angular-v16-provided-in-root && mvn integration-test)
86+
#(cd samples/client/petstore/typescript-angular-v17-provided-in-root && mvn integration-test)
87+
#(cd samples/client/petstore/typescript-angular-v18-provided-in-root && mvn integration-test)
88+
#(cd samples/client/petstore/typescript-angular-v19-provided-in-root && mvn integration-test)
89+
#(cd samples/openapi3/client/petstore/typescript/builds/default && mvn integration-test)
90+
#(cd samples/openapi3/client/petstore/typescript/tests/default && mvn integration-test)
91+
#(cd samples/openapi3/client/petstore/typescript/builds/jquery && mvn integration-test)
92+
#(cd samples/openapi3/client/petstore/typescript/tests/jquery && mvn integration-test)
93+
#(cd samples/openapi3/client/petstore/typescript/builds/object_params && mvn integration-test)
94+
#(cd samples/openapi3/client/petstore/typescript/tests/object_params && mvn integration-test)
95+
#(cd samples/openapi3/client/petstore/typescript/builds/inversify && mvn integration-test)
96+
#(cd samples/openapi3/client/petstore/typescript/tests/inversify && mvn integration-test)
97+
##(cd samples/openapi3/client/petstore/typescript/tests/deno && mvn integration-test)
98+
#(cd samples/openapi3/client/petstore/typescript/builds/browser && mvn integration-test)
99+
#(cd samples/openapi3/client/petstore/typescript/tests/browser && mvn integration-test)
100+
#(cd samples/openapi3/client/petstore/typescript/builds/nullable-enum && mvn integration-test)
101+
#(cd samples/client/petstore/typescript-fetch/builds/default && mvn integration-test)
102+
#(cd samples/client/petstore/typescript-fetch/builds/es6-target && mvn integration-test)
103+
#(cd samples/client/petstore/typescript-fetch/builds/with-npm-version && mvn integration-test)
104+
#(cd samples/client/petstore/typescript-fetch/tests/default && mvn integration-test)
105+
#(cd samples/client/petstore/typescript-node/npm && mvn integration-test)
106+
#(cd samples/client/petstore/typescript-rxjs/builds/with-npm-version && mvn integration-test)
107+
#(cd samples/client/petstore/typescript-axios/builds/with-npm-version && mvn integration-test)
108+
#(cd samples/client/petstore/typescript-axios/tests/default && mvn integration-test)
109+
#(cd samples/client/petstore/typescript-axios/tests/with-complex-headers && mvn integration-test)
110110

111111
else
112112
echo "Running node $NODE_INDEX ..."

samples/client/others/typescript-angular/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@
6060
</plugins>
6161
</build>
6262
</project>
63+

samples/client/petstore/typescript-axios/tests/default/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,4 @@
5757
</plugins>
5858
</build>
5959
</project>
60+

samples/openapi3/client/petstore/typescript/builds/nullable-enum/pom.xml

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)