From fdf53ac01e5aee9f4b8117a54b25e723b3524a34 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 19 Apr 2023 16:17:45 +0800 Subject: [PATCH] update mvn in workflow to use gradle enterprise (#15256) --- .../workflows/check-supported-versions.yaml | 4 ++ .github/workflows/gradle-enterprise.yaml | 42 ------------------- .github/workflows/gradle-plugin-tests.yaml | 2 + .../java-helidon-functional-tests.yaml | 2 + .github/workflows/maven-plugin-tests.yaml | 2 + .github/workflows/openapi-generator.yaml | 4 ++ 6 files changed, 14 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/gradle-enterprise.yaml diff --git a/.github/workflows/check-supported-versions.yaml b/.github/workflows/check-supported-versions.yaml index c46a56cfab9b..5356051b5d66 100644 --- a/.github/workflows/check-supported-versions.yaml +++ b/.github/workflows/check-supported-versions.yaml @@ -48,6 +48,8 @@ jobs: - name: Build with Maven shell: bash run: mvn -nsu -B --quiet -Djacoco.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error --no-transfer-progress clean install --file pom.xml ${{ matrix.flags }} + env: + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - name: Upload Maven build artifact uses: actions/upload-artifact@v3 @@ -63,6 +65,8 @@ jobs: - name: Test Maven plugin integration if: matrix.java == '8' shell: bash + env: + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} run: | cd modules/openapi-generator-maven-plugin mvn verify -Pintegration diff --git a/.github/workflows/gradle-enterprise.yaml b/.github/workflows/gradle-enterprise.yaml deleted file mode 100644 index e9435ec41ab0..000000000000 --- a/.github/workflows/gradle-enterprise.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: Gradle Enterprise - -on: - push: - branches: - - master - - '[5-9]+.[0-9]+.x' - pull_request: - branches: - - master - - '[5-9]+.[0-9]+.x' - - 'gradle-enterprise**' - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 8 - uses: actions/setup-java@v3 - with: - java-version: 8 - distribution: 'temurin' - - name: Cache maven dependencies - uses: actions/cache@v3 - 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 clean install - env: - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} diff --git a/.github/workflows/gradle-plugin-tests.yaml b/.github/workflows/gradle-plugin-tests.yaml index a162019bf903..eab2881f3aa7 100644 --- a/.github/workflows/gradle-plugin-tests.yaml +++ b/.github/workflows/gradle-plugin-tests.yaml @@ -35,6 +35,8 @@ jobs: ${{ runner.os }}-test-gradle-plugin-${{ env.cache-name }}- ${{ runner.os }}-test-gradle-plugin- - name: Run tests + env: + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} run: | mvn --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk) # using gradle-6.8.3 via wrapper diff --git a/.github/workflows/java-helidon-functional-tests.yaml b/.github/workflows/java-helidon-functional-tests.yaml index b2404063d8f8..a57bf72503c8 100644 --- a/.github/workflows/java-helidon-functional-tests.yaml +++ b/.github/workflows/java-helidon-functional-tests.yaml @@ -38,6 +38,8 @@ jobs: ${{ runner.os }}-build- - name: Run unit tests run: cd modules/openapi-generator && mvn --no-snapshot-updates --batch-mode -Dtest="**/functional/*Test" test -Dorg.slf4j.simpleLogger.defaultLogLevel=error + env: + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - name: Publish unit test reports if: ${{ always() }} uses: actions/upload-artifact@v3 diff --git a/.github/workflows/maven-plugin-tests.yaml b/.github/workflows/maven-plugin-tests.yaml index 4f3fe58a2f18..c4a5aa677947 100644 --- a/.github/workflows/maven-plugin-tests.yaml +++ b/.github/workflows/maven-plugin-tests.yaml @@ -34,6 +34,8 @@ jobs: ${{ 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: | mvn clean install -DskipTests -Dmaven.javadoc.skip=true mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index fcbf678e89c6..31142be3c719 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -37,6 +37,8 @@ jobs: ${{ runner.os }}-build- - name: Run maven run: mvn --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error + env: + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - run: ls -la modules/openapi-generator-cli/target - name: Upload openapi-generator-cli.jar artifact uses: actions/upload-artifact@v3 @@ -73,6 +75,8 @@ jobs: ${{ runner.os }}-build- - name: Run unit tests run: mvn --no-snapshot-updates --batch-mode --quiet --fail-at-end test -Dorg.slf4j.simpleLogger.defaultLogLevel=error + env: + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - name: Publish unit test reports if: ${{ always() }} uses: actions/upload-artifact@v3