Move examples to reusable workflow (#5482)
* Move examples to reusable workflow * ci.yml too
This commit is contained in:
parent
cd396bca23
commit
4ad785a1da
|
@ -122,39 +122,7 @@ jobs:
|
||||||
uses: ./.github/workflows/muzzle.yml
|
uses: ./.github/workflows/muzzle.yml
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
runs-on: ubuntu-latest
|
uses: ./.github/workflows/examples.yml
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up JDK 11 for running Gradle
|
|
||||||
uses: actions/setup-java@v2
|
|
||||||
with:
|
|
||||||
distribution: adopt
|
|
||||||
java-version: 11
|
|
||||||
|
|
||||||
- name: Set up gradle cache
|
|
||||||
uses: gradle/gradle-build-action@v2
|
|
||||||
|
|
||||||
- name: Local publish of artifacts
|
|
||||||
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
|
|
||||||
run: ./gradlew publishToMavenLocal -x javadoc
|
|
||||||
|
|
||||||
- name: Local publish of gradle plugins
|
|
||||||
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
|
|
||||||
run: ./gradlew publishToMavenLocal -x javadoc
|
|
||||||
working-directory: gradle-plugins
|
|
||||||
|
|
||||||
- name: Build distro
|
|
||||||
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/distro
|
|
||||||
|
|
||||||
- name: Build extension
|
|
||||||
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/extension
|
|
||||||
|
|
||||||
- name: Run muzzle check against extension
|
|
||||||
run: ./gradlew muzzle --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/extension
|
|
||||||
|
|
||||||
markdown-link-check:
|
markdown-link-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
name: Examples
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
cache-read-only:
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
no-build-cache:
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
examples:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up JDK 11 for running Gradle
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
distribution: adopt
|
||||||
|
java-version: 11
|
||||||
|
|
||||||
|
- name: Set up gradle cache
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
with:
|
||||||
|
cache-read-only: ${{ inputs.cache-read-only }}
|
||||||
|
|
||||||
|
- name: Local publish of artifacts
|
||||||
|
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
|
||||||
|
run: ./gradlew publishToMavenLocal -x javadoc
|
||||||
|
|
||||||
|
- name: Local publish of gradle plugins
|
||||||
|
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
|
||||||
|
run: ./gradlew publishToMavenLocal -x javadoc
|
||||||
|
working-directory: gradle-plugins
|
||||||
|
|
||||||
|
- name: Build distro
|
||||||
|
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
|
||||||
|
working-directory: examples/distro
|
||||||
|
|
||||||
|
- name: Build extension
|
||||||
|
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
|
||||||
|
working-directory: examples/extension
|
||||||
|
|
||||||
|
- name: Run muzzle check against extension
|
||||||
|
run: ./gradlew muzzle --init-script ../../.github/scripts/local.init.gradle.kts
|
||||||
|
working-directory: examples/extension
|
|
@ -107,39 +107,9 @@ jobs:
|
||||||
# it doesn't use gradle cache anyways and so is already covered by the normal nightly build
|
# it doesn't use gradle cache anyways and so is already covered by the normal nightly build
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
runs-on: ubuntu-latest
|
uses: ./.github/workflows/examples.yml
|
||||||
steps:
|
with:
|
||||||
- uses: actions/checkout@v3
|
no-build-cache: true
|
||||||
|
|
||||||
- name: Set up JDK 11 for running Gradle
|
|
||||||
uses: actions/setup-java@v2
|
|
||||||
with:
|
|
||||||
distribution: adopt
|
|
||||||
java-version: 11
|
|
||||||
|
|
||||||
- name: Set up gradle cache
|
|
||||||
uses: gradle/gradle-build-action@v2
|
|
||||||
|
|
||||||
- name: Local publish of artifacts
|
|
||||||
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
|
|
||||||
run: ./gradlew publishToMavenLocal -x javadoc
|
|
||||||
|
|
||||||
- name: Local publish of gradle plugins
|
|
||||||
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
|
|
||||||
run: ./gradlew publishToMavenLocal -x javadoc
|
|
||||||
working-directory: gradle-plugins
|
|
||||||
|
|
||||||
- name: Build distro
|
|
||||||
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts --no-build-cache
|
|
||||||
working-directory: examples/distro
|
|
||||||
|
|
||||||
- name: Build extension
|
|
||||||
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts --no-build-cache
|
|
||||||
working-directory: examples/extension
|
|
||||||
|
|
||||||
- name: Run muzzle check against extension
|
|
||||||
run: ./gradlew muzzle --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/extension
|
|
||||||
|
|
||||||
# markdown-link-check is intentionally not included in the nightly-no-cache build because
|
# markdown-link-check 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
|
# it doesn't use gradle cache anyways and so is already covered by the normal nightly build
|
||||||
|
|
|
@ -113,39 +113,7 @@ jobs:
|
||||||
uses: ./.github/workflows/muzzle.yml
|
uses: ./.github/workflows/muzzle.yml
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
runs-on: ubuntu-latest
|
uses: ./.github/workflows/examples.yml
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up JDK 11 for running Gradle
|
|
||||||
uses: actions/setup-java@v2
|
|
||||||
with:
|
|
||||||
distribution: adopt
|
|
||||||
java-version: 11
|
|
||||||
|
|
||||||
- name: Set up gradle cache
|
|
||||||
uses: gradle/gradle-build-action@v2
|
|
||||||
|
|
||||||
- name: Local publish of artifacts
|
|
||||||
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
|
|
||||||
run: ./gradlew publishToMavenLocal -x javadoc
|
|
||||||
|
|
||||||
- name: Local publish of gradle plugins
|
|
||||||
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
|
|
||||||
run: ./gradlew publishToMavenLocal -x javadoc
|
|
||||||
working-directory: gradle-plugins
|
|
||||||
|
|
||||||
- name: Build distro
|
|
||||||
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/distro
|
|
||||||
|
|
||||||
- name: Build extension
|
|
||||||
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/extension
|
|
||||||
|
|
||||||
- name: Run muzzle check against extension
|
|
||||||
run: ./gradlew muzzle --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/extension
|
|
||||||
|
|
||||||
markdown-link-check:
|
markdown-link-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -173,41 +173,9 @@ jobs:
|
||||||
uses: ./.github/workflows/muzzle.yml
|
uses: ./.github/workflows/muzzle.yml
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
runs-on: ubuntu-latest
|
uses: ./.github/workflows/examples.yml
|
||||||
steps:
|
with:
|
||||||
- uses: actions/checkout@v3
|
cache-read-only: true
|
||||||
|
|
||||||
- name: Set up JDK 11 for running Gradle
|
|
||||||
uses: actions/setup-java@v2
|
|
||||||
with:
|
|
||||||
distribution: adopt
|
|
||||||
java-version: 11
|
|
||||||
|
|
||||||
- name: Set up gradle cache
|
|
||||||
uses: gradle/gradle-build-action@v2
|
|
||||||
with:
|
|
||||||
cache-read-only: true
|
|
||||||
|
|
||||||
- name: Local publish of artifacts
|
|
||||||
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
|
|
||||||
run: ./gradlew publishToMavenLocal -x javadoc
|
|
||||||
|
|
||||||
- name: Local publish of gradle plugins
|
|
||||||
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
|
|
||||||
run: ./gradlew publishToMavenLocal -x javadoc
|
|
||||||
working-directory: gradle-plugins
|
|
||||||
|
|
||||||
- name: Build distro
|
|
||||||
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/distro
|
|
||||||
|
|
||||||
- name: Build extension
|
|
||||||
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/extension
|
|
||||||
|
|
||||||
- name: Run muzzle check against extension
|
|
||||||
run: ./gradlew muzzle --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/extension
|
|
||||||
|
|
||||||
# markdown-link-check is not included in the PR build because links to external urls can break at
|
# markdown-link-check is not included in the PR build because links to external urls can break at
|
||||||
# any time, which can be confusing for contributors
|
# any time, which can be confusing for contributors
|
||||||
|
|
|
@ -56,41 +56,7 @@ jobs:
|
||||||
# and this is not a reason to hold up the release
|
# and this is not a reason to hold up the release
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
runs-on: ubuntu-latest
|
uses: ./.github/workflows/examples.yml
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
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: Set up gradle cache
|
|
||||||
uses: gradle/gradle-build-action@v2
|
|
||||||
|
|
||||||
- name: Local publish of artifacts
|
|
||||||
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
|
|
||||||
run: ./gradlew publishToMavenLocal -x javadoc
|
|
||||||
|
|
||||||
- name: Local publish of gradle plugins
|
|
||||||
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
|
|
||||||
run: ./gradlew publishToMavenLocal -x javadoc
|
|
||||||
working-directory: gradle-plugins
|
|
||||||
|
|
||||||
- name: Build distro
|
|
||||||
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/distro
|
|
||||||
|
|
||||||
- name: Build extension
|
|
||||||
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/extension
|
|
||||||
|
|
||||||
- name: Run muzzle check against extension
|
|
||||||
run: ./gradlew muzzle --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/extension
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [ test, smoke-test, examples ]
|
needs: [ test, smoke-test, examples ]
|
||||||
|
|
|
@ -48,41 +48,7 @@ jobs:
|
||||||
# and this is not a reason to hold up the release
|
# and this is not a reason to hold up the release
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
runs-on: ubuntu-latest
|
uses: ./.github/workflows/examples.yml
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
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: Set up gradle cache
|
|
||||||
uses: gradle/gradle-build-action@v2
|
|
||||||
|
|
||||||
- name: Local publish of artifacts
|
|
||||||
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
|
|
||||||
run: ./gradlew publishToMavenLocal -x javadoc
|
|
||||||
|
|
||||||
- name: Local publish of gradle plugins
|
|
||||||
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
|
|
||||||
run: ./gradlew publishToMavenLocal -x javadoc
|
|
||||||
working-directory: gradle-plugins
|
|
||||||
|
|
||||||
- name: Build distro
|
|
||||||
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/distro
|
|
||||||
|
|
||||||
- name: Build extension
|
|
||||||
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/extension
|
|
||||||
|
|
||||||
- name: Run muzzle check against extension
|
|
||||||
run: ./gradlew muzzle --init-script ../../.github/scripts/local.init.gradle.kts
|
|
||||||
working-directory: examples/extension
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [ test, smoke-test, examples ]
|
needs: [ test, smoke-test, examples ]
|
||||||
|
|
Loading…
Reference in New Issue