Skip to content

Commit d71105a

Browse files
authored
Merge pull request #1 from OpenAPITools/master
merge upstream
2 parents 53e5986 + 3c866fb commit d71105a

File tree

4,004 files changed

+120057
-20033
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,004 files changed

+120057
-20033
lines changed

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ jobs:
8282
- ~/.bundle
8383
- ~/.go_workspace
8484
- ~/.gradle
85-
- ~/.pub-cache
8685
- ~/.cache/bower
8786
- ".git"
8887
- ~/.stack
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'Run samples'
2+
description: 'Runs sample integration test profile with Maven'
3+
inputs:
4+
name:
5+
description: 'The Maven profile name'
6+
required: true
7+
goal:
8+
description: 'Maven goal'
9+
required: false
10+
default: 'verify'
11+
args:
12+
description: 'Additional maven arguments'
13+
required: false
14+
default: ''
15+
runs:
16+
using: "composite"
17+
steps:
18+
- run: mvn --no-snapshot-updates --batch-mode --quiet ${{ inputs.goal }} -P${{ inputs.name }} -Dintegration-test -Dmaven.javadoc.skip=true ${{ inputs.args }}
19+
shell: bash

.github/workflows/check-supported-versions.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,19 @@ jobs:
2424
uses: actions/checkout@v2
2525

2626
- name: Set up JDK ${{ matrix.java }}
27-
uses: actions/setup-java@v1
27+
uses: actions/setup-java@v2
2828
with:
29+
distribution: 'adopt'
2930
java-version: ${{ matrix.java }}
3031

31-
- uses: actions/[email protected].4
32+
- uses: actions/[email protected].5
3233
with:
3334
path: ~/.m2/repository
3435
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', 'modules/**/pom.xml') }}
3536
restore-keys: |
3637
${{ runner.os }}-maven-
3738
38-
- uses: actions/[email protected].4
39+
- uses: actions/[email protected].5
3940
with:
4041
path: |
4142
~/.gradle/caches
@@ -49,7 +50,7 @@ jobs:
4950
run: mvn -nsu -B --quiet -Djacoco.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error --no-transfer-progress clean install --file pom.xml ${{ matrix.flags }}
5051

5152
- name: Upload Maven build artifact
52-
uses: actions/[email protected].2
53+
uses: actions/[email protected].3
5354
if: matrix.java == '8' && matrix.os == 'ubuntu-latest'
5455
with:
5556
name: artifact
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: OpenAPI Generator Test Report
2+
3+
on:
4+
workflow_run:
5+
workflows: ['OpenAPI Generator']
6+
types:
7+
- completed
8+
9+
# separate workflow required due to https://github.com/dorny/test-reporter#recommended-setup-for-public-repositories
10+
jobs:
11+
report:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: dorny/test-reporter@v1
15+
with:
16+
artifact: surefire-test-results
17+
name: JUnit Test results
18+
path: '**/surefire-reports/TEST-*.xml'
19+
reporter: java-junit
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
name: OpenAPI Generator
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- '[5-9]+.[0-9]+.x'
8+
pull_request:
9+
branches:
10+
- master
11+
- '[5-9]+.[0-9]+.x'
12+
13+
jobs:
14+
build:
15+
name: Build
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up JDK 8
20+
uses: actions/setup-java@v1
21+
with:
22+
java-version: 8
23+
- name: Cache maven dependencies
24+
uses: actions/cache@v2
25+
env:
26+
cache-name: cache-maven-repository
27+
with:
28+
path: |
29+
~/.m2/repository
30+
~/.gradle
31+
!~/.gradle/caches/*/plugin-resolution/
32+
!~/.m2/repository/org/openapitools/
33+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
34+
restore-keys: |
35+
${{ runner.os }}-build-${{ env.cache-name }}-
36+
${{ runner.os }}-build-
37+
- name: Run maven
38+
run: mvn --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error
39+
- run: ls -la modules/openapi-generator-cli/target
40+
- name: Upload openapi-generator-cli.jar artifact
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: openapi-generator-cli.jar
44+
path: modules/openapi-generator-cli/target/openapi-generator-cli.jar
45+
retention-days: 1
46+
47+
test:
48+
name: Unit tests
49+
runs-on: ubuntu-latest
50+
needs:
51+
- build
52+
steps:
53+
- uses: actions/checkout@v2
54+
- name: Set up JDK 8
55+
uses: actions/setup-java@v1
56+
with:
57+
java-version: 8
58+
- name: Cache maven dependencies
59+
uses: actions/cache@v2
60+
env:
61+
cache-name: cache-maven-repository
62+
with:
63+
path: |
64+
~/.m2/repository
65+
~/.gradle
66+
!~/.gradle/caches/*/plugin-resolution/
67+
!~/.m2/repository/org/openapitools/
68+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
69+
restore-keys: |
70+
${{ runner.os }}-build-${{ env.cache-name }}-
71+
${{ runner.os }}-build-
72+
- name: Run unit tests
73+
run: mvn --no-snapshot-updates --batch-mode --quiet --fail-at-end test -Dorg.slf4j.simpleLogger.defaultLogLevel=error
74+
- name: Publish unit test reports
75+
if: ${{ always() }}
76+
uses: actions/upload-artifact@v2
77+
with:
78+
name: surefire-test-results
79+
path: '**/surefire-reports/TEST-*.xml'
80+
81+
documentation:
82+
name: Docs up-to-date
83+
runs-on: ubuntu-latest
84+
needs:
85+
- build
86+
steps:
87+
- uses: actions/checkout@v2
88+
- name: Set up JDK 8
89+
uses: actions/setup-java@v1
90+
with:
91+
java-version: 8
92+
- name: Download openapi-generator-cli.jar artifact
93+
uses: actions/download-artifact@v2
94+
with:
95+
name: openapi-generator-cli.jar
96+
path: modules/openapi-generator-cli/target
97+
- name: Generate docs
98+
run: |
99+
bash bin/meta-codegen.sh
100+
bash bin/utils/export_docs_generators.sh
101+
bash bin/utils/copy-to-website.sh
102+
bash bin/utils/export_generators_readme.sh
103+
- name: Verify git status
104+
run: |
105+
if [[ "$(git status --porcelain)" != "" ]]; then
106+
echo "UNCOMMITTED CHANGES ERROR"
107+
echo "There are uncommitted changes in working tree after execution of 'bin/ensure-up-to-date'"
108+
echo "Perform git diff"
109+
git --no-pager diff
110+
echo "Perform git status"
111+
git status
112+
echo -e "\nThis script runs in pull requests against the anticipated merge commit (as if the PR was merged now)."
113+
echo "When you see unexpected files here, it likely means that there are newer commits in master that you need to "
114+
echo -e "rebase or merge into your branch.\n"
115+
echo "Please run 'bin/utils/ensure-up-to-date' locally and commit changes (UNCOMMITTED CHANGES ERROR)"
116+
exit 1
117+
fi
118+
119+
samples:
120+
name: Samples up-to-date
121+
needs:
122+
- build
123+
runs-on: ubuntu-latest
124+
steps:
125+
- uses: actions/checkout@v2
126+
- name: Set up JDK 8
127+
uses: actions/setup-java@v1
128+
with:
129+
java-version: 8
130+
- name: Download openapi-generator-cli.jar artifact
131+
uses: actions/download-artifact@v2
132+
with:
133+
name: openapi-generator-cli.jar
134+
path: modules/openapi-generator-cli/target
135+
- name: Generate samples
136+
run: bash bin/generate-samples.sh
137+
- name: Verify git status
138+
run: |
139+
if [[ "$(git status --porcelain)" != "" ]]; then
140+
echo "UNCOMMITTED CHANGES ERROR"
141+
echo "There are uncommitted changes in working tree after execution of 'bin/generate-samples.sh'"
142+
echo "Perform git diff"
143+
git --no-pager diff
144+
echo "Perform git status"
145+
git status
146+
echo -e "\nThis script runs in pull requests against the anticipated merge commit (as if the PR was merged now)."
147+
echo "When you see unexpected files here, it likely means that there are newer commits in master that you need to "
148+
echo -e "rebase or merge into your branch.\n"
149+
echo "Please run 'bin/generate-samples.sh' locally and commit changes (UNCOMMITTED CHANGES ERROR)"
150+
exit 1
151+
fi
152+
153+
test-maven-plugin:
154+
name: Maven plugin tests
155+
runs-on: ubuntu-latest
156+
needs:
157+
- build
158+
steps:
159+
- uses: actions/checkout@v2
160+
- name: Set up JDK 11
161+
uses: actions/setup-java@v1
162+
with:
163+
java-version: 11
164+
- name: Cache maven dependencies
165+
uses: actions/cache@v2
166+
env:
167+
cache-name: cache-maven-repository
168+
with:
169+
path: |
170+
~/.m2/repository
171+
~/.gradle
172+
!~/.gradle/caches/*/plugin-resolution/
173+
!~/.m2/repository/org/openapitools/
174+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
175+
restore-keys: |
176+
${{ runner.os }}-test-maven-plugin-${{ env.cache-name }}-
177+
${{ runner.os }}-test-maven-plugin-
178+
- name: Run tests
179+
run: |
180+
mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
181+
mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
182+
mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
183+
mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
184+
185+
test-gradle-plugin:
186+
name: Gradle plugin tests
187+
runs-on: ubuntu-latest
188+
needs:
189+
- build
190+
steps:
191+
- uses: actions/checkout@v2
192+
- name: Set up JDK 11
193+
uses: actions/setup-java@v1
194+
with:
195+
java-version: 11
196+
- name: Cache maven dependencies
197+
uses: actions/cache@v2
198+
env:
199+
cache-name: cache-maven-repository
200+
with:
201+
path: |
202+
~/.m2/repository
203+
~/.gradle
204+
!~/.gradle/caches/modules-2/modules-2.lock
205+
!~/.gradle/caches/*/plugin-resolution/
206+
!~/.m2/repository/org/openapitools/
207+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
208+
restore-keys: |
209+
${{ runner.os }}-test-gradle-plugin-${{ env.cache-name }}-
210+
${{ runner.os }}-test-gradle-plugin-
211+
- name: Run tests
212+
run: |
213+
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk)
214+
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate)
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Samples Dart
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- '[5-9]+.[0-9]+.x'
8+
pull_request:
9+
branches:
10+
- master
11+
- '[5-9]+.[0-9]+.x'
12+
13+
jobs:
14+
tests-dart-2-10:
15+
name: Tests Dart 2.10
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: actions/setup-java@v2
20+
with:
21+
distribution: 'adopt'
22+
java-version: 8
23+
- name: Cache maven dependencies
24+
uses: actions/cache@v2
25+
env:
26+
cache-name: maven-repository
27+
with:
28+
path: |
29+
~/.m2/repository
30+
~/.gradle
31+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
32+
- name: Cache test dependencies
33+
uses: actions/cache@v2
34+
env:
35+
cache-name: pub-cache
36+
with:
37+
path: $PUB_CACHE
38+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('samples/**/pubspec.yaml') }}
39+
- uses: dart-lang/setup-dart@v1
40+
with:
41+
sdk: 2.10.5
42+
- name: Run tests
43+
uses: ./.github/actions/run-samples
44+
with:
45+
name: samples.dart-2.10
46+
47+
tests-dart-2-13:
48+
name: Tests Dart 2.13
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v2
52+
- uses: actions/setup-java@v2
53+
with:
54+
distribution: 'adopt'
55+
java-version: 8
56+
- name: Cache maven dependencies
57+
uses: actions/cache@v2
58+
env:
59+
cache-name: maven-repository
60+
with:
61+
path: |
62+
~/.m2/repository
63+
~/.gradle
64+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
65+
- name: Cache test dependencies
66+
uses: actions/cache@v2
67+
env:
68+
cache-name: pub-cache
69+
with:
70+
path: $PUB_CACHE
71+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('samples/**/pubspec.yaml') }}
72+
- uses: dart-lang/setup-dart@v1
73+
with:
74+
sdk: 2.13.0
75+
- name: Run tests
76+
uses: ./.github/actions/run-samples
77+
with:
78+
name: samples.dart-2.13

0 commit comments

Comments
 (0)