Another reusable workflow
MODIFY
.github/workflows/ci.yml
.github/workflows/ci.yml
@@ -108,46 +108,11 @@ jobs:
arguments: test -PtestLatestDeps=true
smoke-test:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os:
- - windows-2019
- - ubuntu-latest
- smoke-test-suite:
- - jetty
- - liberty
- - payara
- - tomcat
- - tomee
- - websphere
- - wildfly
- - other
- exclude:
- - os: windows-2019
- smoke-test-suite: websphere
- fail-fast: false
- steps:
- - name: Support longpaths
- run: git config --system core.longpaths true
- if: matrix.os == 'windows-2019'
-
- - uses: actions/checkout@v2.3.4
-
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: adopt
- java-version: 11
-
- - name: Test
- env:
+ uses: ./.github/workflows/smoke-test.yml
+ secrets:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
GE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
- uses: gradle/gradle-build-action@v2
- with:
- arguments: ":smoke-tests:test -PsmokeTestSuite=${{ matrix.smoke-test-suite }}"
muzzle:
# release branches are excluded

MODIFY
.github/workflows/nightly-no-cache.yml
.github/workflows/nightly-no-cache.yml
@@ -97,44 +97,11 @@ jobs:
arguments: test -PtestLatestDeps=true --no-build-cache
smoke-test:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os:
- - windows-2019
- - ubuntu-latest
- smoke-test-suite:
- - jetty
- - liberty
- - payara
- - tomcat
- - tomee
- - websphere
- - wildfly
- - other
- exclude:
- - os: windows-2019
- smoke-test-suite: websphere
- fail-fast: false
- steps:
- - name: Support longpaths
- run: git config --system core.longpaths true
- if: matrix.os == 'windows-2019'
-
- - uses: actions/checkout@v2.3.4
-
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
+ uses: ./.github/workflows/smoke-test.yml
with:
- distribution: adopt
- java-version: 11
-
- - name: Test
- env:
+ no-build-cache: true
+ secrets:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- uses: gradle/gradle-build-action@v2
- with:
- arguments: ":smoke-tests:test -PsmokeTestSuite=${{ matrix.smoke-test-suite }} --no-build-cache"
# muzzle is intentionally not included in the nightly-no-cache build because
# it doesn't use gradle cache anyways and so is already covered by the normal nightly build

MODIFY
.github/workflows/nightly.yml
.github/workflows/nightly.yml
@@ -103,46 +103,11 @@ jobs:
arguments: test -PtestLatestDeps=true
smoke-test:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os:
- - windows-2019
- - ubuntu-latest
- smoke-test-suite:
- - jetty
- - liberty
- - payara
- - tomcat
- - tomee
- - websphere
- - wildfly
- - other
- exclude:
- - os: windows-2019
- smoke-test-suite: websphere
- fail-fast: false
- steps:
- - name: Support longpaths
- run: git config --system core.longpaths true
- if: matrix.os == 'windows-2019'
-
- - uses: actions/checkout@v2.3.4
-
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: adopt
- java-version: 11
-
- - name: Test
- env:
+ uses: ./.github/workflows/smoke-test.yml
+ secrets:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
GE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
- uses: gradle/gradle-build-action@v2
- with:
- arguments: ":smoke-tests:test -PsmokeTestSuite=${{ matrix.smoke-test-suite }}"
muzzle:
uses: ./.github/workflows/muzzle.yml

MODIFY
.github/workflows/pr.yml
.github/workflows/pr.yml
@@ -159,43 +159,7 @@ jobs:
cache-read-only: true
smoke-test:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os:
- - windows-2019
- - ubuntu-latest
- smoke-test-suite:
- - jetty
- - liberty
- - payara
- - tomcat
- - tomee
- - websphere
- - wildfly
- - other
- exclude:
- - os: windows-2019
- smoke-test-suite: websphere
- fail-fast: false
- steps:
- - name: Support longpaths
- run: git config --system core.longpaths true
- if: matrix.os == 'windows-2019'
-
- - uses: actions/checkout@v2.3.4
-
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: adopt
- java-version: 11
-
- - name: Test
- uses: gradle/gradle-build-action@v2
- with:
- cache-read-only: true
- arguments: ":smoke-tests:test -PsmokeTestSuite=${{ matrix.smoke-test-suite }}"
+ uses: ./.github/workflows/smoke-test.yml
muzzle:
# release branches are excluded

MODIFY
.github/workflows/release-gradle-plugins.yml
.github/workflows/release-gradle-plugins.yml
@@ -49,43 +49,7 @@ jobs:
# or due to slight changes in emitted telemetry
smoke-test:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os:
- - windows-2019
- - ubuntu-latest
- smoke-test-suite:
- - jetty
- - liberty
- - payara
- - tomcat
- - tomee
- - websphere
- - wildfly
- - other
- exclude:
- - os: windows-2019
- smoke-test-suite: websphere
- steps:
- - name: Support longpaths
- run: git config --system core.longpaths true
- if: matrix.os == 'windows-2019'
-
- - uses: actions/checkout@v2.3.4
- with:
- ref: ${{ github.event.inputs.release-branch-name }}
-
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: adopt
- java-version: 11
-
- - name: Test
- uses: gradle/gradle-build-action@v2
- with:
- arguments: ":smoke-tests:test -PsmokeTestSuite=${{ matrix.smoke-test-suite }}"
+ uses: ./.github/workflows/smoke-test.yml
# muzzle is intentionally not included in the release workflows
# because any time a new library version is released to maven central it can fail,

MODIFY
.github/workflows/release.yml
.github/workflows/release.yml
@@ -41,43 +41,7 @@ jobs:
# or due to slight changes in emitted telemetry
smoke-test:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os:
- - windows-2019
- - ubuntu-latest
- smoke-test-suite:
- - jetty
- - liberty
- - payara
- - tomcat
- - tomee
- - websphere
- - wildfly
- - other
- exclude:
- - os: windows-2019
- smoke-test-suite: websphere
- steps:
- - name: Support longpaths
- run: git config --system core.longpaths true
- if: matrix.os == 'windows-2019'
-
- - uses: actions/checkout@v2.3.4
- with:
- ref: ${{ github.ref_name }}
-
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: adopt
- java-version: 11
-
- - name: Test
- uses: gradle/gradle-build-action@v2
- with:
- arguments: ":smoke-tests:test -PsmokeTestSuite=${{ matrix.smoke-test-suite }}"
+ uses: ./.github/workflows/smoke-test.yml
# muzzle is intentionally not included in the release workflows
# because any time a new library version is released to maven central it can fail,

ADD
.github/workflows/smoke-test.yml
+name: Smoke test
+
+on:
+ workflow_call:
+ inputs:
+ cache-read-only:
+ type: boolean
+ required: false
+ no-build-cache:
+ type: boolean
+ required: false
+ secrets:
+ GRADLE_ENTERPRISE_ACCESS_KEY:
+ required: false
+ GE_CACHE_USERNAME:
+ required: false
+ GE_CACHE_PASSWORD:
+ required: false
+
+jobs:
+ smoke-test:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os:
+ - windows-2019
+ - ubuntu-latest
+ smoke-test-suite:
+ - jetty
+ - liberty
+ - payara
+ - tomcat
+ - tomee
+ - websphere
+ - wildfly
+ - other
+ exclude:
+ - os: windows-2019
+ smoke-test-suite: websphere
+ fail-fast: false
+ steps:
+ - name: Support longpaths
+ run: git config --system core.longpaths true
+ if: matrix.os == 'windows-2019'
+
+ - uses: actions/checkout@v2.3.4
+
+ - name: Set up JDK 11 for running Gradle
+ uses: actions/setup-java@v2
+ with:
+ distribution: adopt
+ java-version: 11
+
+ - name: Test
+ env:
+ GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
+ GE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
+ GE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
+ uses: gradle/gradle-build-action@v2
+ with:
+ arguments: ":smoke-tests:test -PsmokeTestSuite=${{ matrix.smoke-test-suite }}${{ inputs.no-build-cache && ' --no-build-cache' || '' }}"
+ cache-read-only: ${{ inputs.cache-read-only }}

Another reusable workflow (#5470)