openapi-generator-original/.github/workflows/maven-plugin-tests.yaml
Paul Parenko 5612852fb6
Remove dependency scan for inputSpec (actually not required) (#19084)
* added test with external-ref ("external dependency" installed before actual usage)

* fixed test with resource on classpath

added test with resource on classpath with external-ref.

Test with profile 'resource' was wrong as it took JAR into account, but there was no 'petstore.yaml' on classpath.

* Remove dependency scan and do not modify inputSpec provided by user

It is still possible to provide JARs as inputSpec, however the user has to provide it by hand.

Providing dependencies in plugin section still allows correct inputSpec resolution on classpath.
2024-07-09 16:37:54 +08:00

46 lines
2.0 KiB
YAML

name: Maven plugin tests
on:
push:
paths:
- modules/openapi-generator-maven-plugin/**
pull_request:
paths:
- modules/openapi-generator-maven-plugin/**
jobs:
test:
name: Maven plugin tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Cache maven dependencies
uses: actions/cache@v4
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
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
run: |
./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true
./mvnw --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
./mvnw --no-snapshot-updates --quiet clean install -f modules/openapi-generator-maven-plugin/examples/multi-module/sample-external-ref-schema/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
./mvnw --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
./mvnw --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
./mvnw --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error