Skip to content

Commit

Permalink
Merge pull request #1 from OpenAPITools/master
Browse files Browse the repository at this point in the history
merge upstream
  • Loading branch information
devhl-labs committed Jun 2, 2021
2 parents 53e5986 + 3c866fb commit d71105a
Show file tree
Hide file tree
Showing 4,004 changed files with 120,057 additions and 20,033 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ jobs:
- ~/.bundle
- ~/.go_workspace
- ~/.gradle
- ~/.pub-cache
- ~/.cache/bower
- ".git"
- ~/.stack
Expand Down
19 changes: 19 additions & 0 deletions .github/actions/run-samples/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Run samples'
description: 'Runs sample integration test profile with Maven'
inputs:
name:
description: 'The Maven profile name'
required: true
goal:
description: 'Maven goal'
required: false
default: 'verify'
args:
description: 'Additional maven arguments'
required: false
default: ''
runs:
using: "composite"
steps:
- run: mvn --no-snapshot-updates --batch-mode --quiet ${{ inputs.goal }} -P${{ inputs.name }} -Dintegration-test -Dmaven.javadoc.skip=true ${{ inputs.args }}
shell: bash
9 changes: 5 additions & 4 deletions .github/workflows/check-supported-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,19 @@ jobs:
uses: actions/checkout@v2

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}

- uses: actions/[email protected].4
- uses: actions/[email protected].5
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', 'modules/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/[email protected].4
- uses: actions/[email protected].5
with:
path: |
~/.gradle/caches
Expand All @@ -49,7 +50,7 @@ jobs:
run: mvn -nsu -B --quiet -Djacoco.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error --no-transfer-progress clean install --file pom.xml ${{ matrix.flags }}

- name: Upload Maven build artifact
uses: actions/[email protected].2
uses: actions/[email protected].3
if: matrix.java == '8' && matrix.os == 'ubuntu-latest'
with:
name: artifact
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/openapi-generator-test-results.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: OpenAPI Generator Test Report

on:
workflow_run:
workflows: ['OpenAPI Generator']
types:
- completed

# separate workflow required due to https://github.com/dorny/test-reporter#recommended-setup-for-public-repositories
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1
with:
artifact: surefire-test-results
name: JUnit Test results
path: '**/surefire-reports/TEST-*.xml'
reporter: java-junit
214 changes: 214 additions & 0 deletions .github/workflows/openapi-generator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
name: OpenAPI Generator

on:
push:
branches:
- master
- '[5-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[5-9]+.[0-9]+.x'

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Cache maven dependencies
uses: actions/cache@v2
env:
cache-name: cache-maven-repository
with:
path: |
~/.m2/repository
~/.gradle
!~/.gradle/caches/*/plugin-resolution/
!~/.m2/repository/org/openapitools/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- name: Run maven
run: mvn --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error
- run: ls -la modules/openapi-generator-cli/target
- name: Upload openapi-generator-cli.jar artifact
uses: actions/upload-artifact@v2
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target/openapi-generator-cli.jar
retention-days: 1

test:
name: Unit tests
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Cache maven dependencies
uses: actions/cache@v2
env:
cache-name: cache-maven-repository
with:
path: |
~/.m2/repository
~/.gradle
!~/.gradle/caches/*/plugin-resolution/
!~/.m2/repository/org/openapitools/
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- name: Run unit tests
run: mvn --no-snapshot-updates --batch-mode --quiet --fail-at-end test -Dorg.slf4j.simpleLogger.defaultLogLevel=error
- name: Publish unit test reports
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: surefire-test-results
path: '**/surefire-reports/TEST-*.xml'

documentation:
name: Docs up-to-date
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Download openapi-generator-cli.jar artifact
uses: actions/download-artifact@v2
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target
- name: Generate docs
run: |
bash bin/meta-codegen.sh
bash bin/utils/export_docs_generators.sh
bash bin/utils/copy-to-website.sh
bash bin/utils/export_generators_readme.sh
- name: Verify git status
run: |
if [[ "$(git status --porcelain)" != "" ]]; then
echo "UNCOMMITTED CHANGES ERROR"
echo "There are uncommitted changes in working tree after execution of 'bin/ensure-up-to-date'"
echo "Perform git diff"
git --no-pager diff
echo "Perform git status"
git status
echo -e "\nThis script runs in pull requests against the anticipated merge commit (as if the PR was merged now)."
echo "When you see unexpected files here, it likely means that there are newer commits in master that you need to "
echo -e "rebase or merge into your branch.\n"
echo "Please run 'bin/utils/ensure-up-to-date' locally and commit changes (UNCOMMITTED CHANGES ERROR)"
exit 1
fi
samples:
name: Samples up-to-date
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Download openapi-generator-cli.jar artifact
uses: actions/download-artifact@v2
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target
- name: Generate samples
run: bash bin/generate-samples.sh
- name: Verify git status
run: |
if [[ "$(git status --porcelain)" != "" ]]; then
echo "UNCOMMITTED CHANGES ERROR"
echo "There are uncommitted changes in working tree after execution of 'bin/generate-samples.sh'"
echo "Perform git diff"
git --no-pager diff
echo "Perform git status"
git status
echo -e "\nThis script runs in pull requests against the anticipated merge commit (as if the PR was merged now)."
echo "When you see unexpected files here, it likely means that there are newer commits in master that you need to "
echo -e "rebase or merge into your branch.\n"
echo "Please run 'bin/generate-samples.sh' locally and commit changes (UNCOMMITTED CHANGES ERROR)"
exit 1
fi
test-maven-plugin:
name: Maven plugin tests
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache maven dependencies
uses: actions/cache@v2
env:
cache-name: cache-maven-repository
with:
path: |
~/.m2/repository
~/.gradle
!~/.gradle/caches/*/plugin-resolution/
!~/.m2/repository/org/openapitools/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-test-maven-plugin-${{ env.cache-name }}-
${{ runner.os }}-test-maven-plugin-
- name: Run tests
run: |
mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
test-gradle-plugin:
name: Gradle plugin tests
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache maven dependencies
uses: actions/cache@v2
env:
cache-name: cache-maven-repository
with:
path: |
~/.m2/repository
~/.gradle
!~/.gradle/caches/modules-2/modules-2.lock
!~/.gradle/caches/*/plugin-resolution/
!~/.m2/repository/org/openapitools/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-test-gradle-plugin-${{ env.cache-name }}-
${{ runner.os }}-test-gradle-plugin-
- name: Run tests
run: |
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk)
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate)
78 changes: 78 additions & 0 deletions .github/workflows/samples-dart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Samples Dart

on:
push:
branches:
- master
- '[5-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[5-9]+.[0-9]+.x'

jobs:
tests-dart-2-10:
name: Tests Dart 2.10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 8
- name: Cache maven dependencies
uses: actions/cache@v2
env:
cache-name: maven-repository
with:
path: |
~/.m2/repository
~/.gradle
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Cache test dependencies
uses: actions/cache@v2
env:
cache-name: pub-cache
with:
path: $PUB_CACHE
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('samples/**/pubspec.yaml') }}
- uses: dart-lang/setup-dart@v1
with:
sdk: 2.10.5
- name: Run tests
uses: ./.github/actions/run-samples
with:
name: samples.dart-2.10

tests-dart-2-13:
name: Tests Dart 2.13
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 8
- name: Cache maven dependencies
uses: actions/cache@v2
env:
cache-name: maven-repository
with:
path: |
~/.m2/repository
~/.gradle
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Cache test dependencies
uses: actions/cache@v2
env:
cache-name: pub-cache
with:
path: $PUB_CACHE
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('samples/**/pubspec.yaml') }}
- uses: dart-lang/setup-dart@v1
with:
sdk: 2.13.0
- name: Run tests
uses: ./.github/actions/run-samples
with:
name: samples.dart-2.13
Loading

0 comments on commit d71105a

Please sign in to comment.