From 7be7941199e872eaca0d538e7d25c4dc827f1e55 Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 9 Jan 2024 15:15:26 +0800 Subject: [PATCH] Tweak gradle-build-action usages --- .github/workflows/build.yml | 54 +++++++++--------------- .github/workflows/push-documentation.yml | 16 +++---- 2 files changed, 27 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e5585c66..0688744a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,16 +9,15 @@ jobs: with: java-version: 11 distribution: zulu + - uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true # Licensing - name: Licensing - uses: gradle/gradle-build-action@v2 - with: - arguments: --console=plain -S license + run: ./gradlew --console=plain -S license # Coding style - name: Coding style - uses: gradle/gradle-build-action@v2 - with: - arguments: --console=plain -S codenarcAll + run: ./gradlew --console=plain -S codenarcAll build-windows: runs-on: windows-latest steps: @@ -27,6 +26,9 @@ jobs: with: java-version: 11 distribution: zulu + - uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true - name: Cache offline repository uses: actions/cache@v3 with: @@ -35,24 +37,16 @@ jobs: restore-keys: ${{ runner.os }}-offline-repo- # Build - name: Build offline repository - uses: gradle/gradle-build-action@v2 - with: - arguments: --console=plain --no-build-cache :testfixtures-offline-repo:buildOfflineRepositories + run: ./gradlew --console=plain --no-build-cache :testfixtures-offline-repo:buildOfflineRepositories - name: Build - uses: gradle/gradle-build-action@v2 - with: - arguments: --console=plain --warning-mode=all -s clean assemble + run: ./gradlew --console=plain --warning-mode=all -s clean assemble # Test # TODO: Resolve the gem integration test issue. See https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/694 - name: Test - uses: gradle/gradle-build-action@v2 - with: - arguments: --console=plain --warning-mode=all -s check --no-parallel -Djava.net.preferIPv4Stack=true -x gradleTest -x :asciidoctor-gradle-jvm-gems:IntTest --scan + run: ./gradlew --console=plain --warning-mode=all -s check --no-parallel -Djava.net.preferIPv4Stack=true -x gradleTest -x :asciidoctor-gradle-jvm-gems:IntTest --scan # Stop gradlew to avoid locking issues - name: Cleanup - uses: gradle/gradle-build-action@v2 - with: - arguments: --stop + run: ./gradlew --stop build: strategy: matrix: @@ -67,6 +61,9 @@ jobs: with: java-version: ${{ matrix.java }} distribution: zulu + - uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true - name: Cache offline repository uses: actions/cache@v3 with: @@ -74,28 +71,17 @@ jobs: key: ${{ runner.os }}-offline-repo-${{ hashFiles('module-versions.properties') }} restore-keys: ${{ runner.os }}-offline-repo- - name: Build offline repository - uses: gradle/gradle-build-action@v2 - with: - arguments: --console=plain --no-build-cache :testfixtures-offline-repo:buildOfflineRepositories + run: ./gradlew --console=plain --no-build-cache :testfixtures-offline-repo:buildOfflineRepositories # Build - name: Build - uses: gradle/gradle-build-action@v2 - with: - arguments: -i -S --console=plain --no-build-cache assemble + run: ./gradlew -i -S --console=plain --no-build-cache assemble # Integration tests - name: Integration tests (without slides) - uses: gradle/gradle-build-action@v2 - with: - arguments: -i -s --console=plain --no-build-cache test intTest remoteTest --scan + run: ./gradlew -i -s --console=plain --no-build-cache test intTest remoteTest --scan # arguments: -i -s --console=plain --no-build-cache test intTest remoteTest -x asciidoctor-gradle-jvm-slides:intTest # arguments: -i -s --console=plain --no-build-cache test intTest remoteTest -x asciidoctor-gradle-slides-export:intTest -x asciidoctor-gradle-jvm-slides:intTest # TODO: See https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/695 # - name: Integration tests (slides only) -# uses: eskatos/gradle-command-action@v2 -# with: -# arguments: -i -s --console=plain --no-build-cache test asciidoctor-gradle-jvm-slides:intTest asciidoctor-gradle-slides-export:intTest - # Gradle tests +# uses: ./gradlew -i -s --console=plain --no-build-cache test asciidoctor-gradle-jvm-slides:intTest asciidoctor-gradle-slides-export:intTest - name: Gradle tests - uses: gradle/gradle-build-action@v2 - with: - arguments: -i -s --console=plain --no-build-cache gradleTest --scan + run: ./gradlew -i -s --console=plain --no-build-cache gradleTest --scan diff --git a/.github/workflows/push-documentation.yml b/.github/workflows/push-documentation.yml index 3ef6e33cd..84655636b 100644 --- a/.github/workflows/push-documentation.yml +++ b/.github/workflows/push-documentation.yml @@ -12,16 +12,14 @@ jobs: with: java-version: 11 distribution: zulu - - name: Combine documentation - uses: gradle/gradle-build-action@v2 + - uses: gradle/gradle-build-action@v2 with: - build-root-directory: docs - arguments: --console=plain -q combineDocs + gradle-home-cache-cleanup: true + - run: cd docs + - name: Combine documentation + run: ./gradlew --console=plain -q combineDocs - name: Publish documentation - uses: gradle/gradle-build-action@v2 - with: - build-root-directory: docs - arguments: "--console=plain --info :antora:publishDocs :gh-pages:publishDocs + run: ./gradlew --console=plain --info :antora:publishDocs :gh-pages:publishDocs -Dorg.ajoberstar.grgit.auth.username=${{ secrets.GITHUB_PUBLISH_USER }} -Dorg.ajoberstar.grgit.auth.password=${{ secrets.GITHUB_PUBLISH_KEY }} - -Dorg.ajoberstar.grgit.auth.force=hardcoded" + -Dorg.ajoberstar.grgit.auth.force=hardcoded