176 lines
4.8 KiB
YAML
176 lines
4.8 KiB
YAML
name: PR build
|
|
|
|
on: pull_request
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up JDK 11 for running checks
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
- name: Restore cache
|
|
uses: burrunan/gradle-cache-action@v1.10
|
|
with:
|
|
job-id: jdk11
|
|
|
|
- name: Start deadlock detector
|
|
run: .github/scripts/deadlock-detector.sh
|
|
|
|
- name: Build
|
|
run: ./gradlew build --stacktrace -x :smoke-tests:test
|
|
|
|
- name: Upload deadlock detector artifacts
|
|
if: always()
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: deadlock-detector-build
|
|
path: /tmp/deadlock-detector-*
|
|
if-no-files-found: ignore
|
|
|
|
example-distro:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up JDK 11 for running checks
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
- name: Restore cache
|
|
uses: burrunan/gradle-cache-action@v1.10
|
|
with:
|
|
job-id: jdk11
|
|
|
|
- name: Build
|
|
run: ./gradlew build --stacktrace
|
|
working-directory: examples/distro
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
java: [ 8, 15 ]
|
|
fail-fast: false
|
|
steps:
|
|
- uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
- id: setup-test-java
|
|
name: Set up JDK ${{ matrix.java }} for running tests
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: ${{ matrix.java }}
|
|
|
|
- name: Set up JDK 11 for running Gradle
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
- name: Restore cache
|
|
uses: burrunan/gradle-cache-action@v1.10
|
|
with:
|
|
job-id: jdk${{ matrix.java }}
|
|
|
|
- name: Start deadlock detector
|
|
run: .github/scripts/deadlock-detector.sh
|
|
|
|
- name: Test
|
|
run: ./gradlew test -PtestJavaVersion=${{ matrix.java }} --stacktrace -x :smoke-tests:test -Porg.gradle.java.installations.paths=${{ steps.setup-test-java.outputs.path }} -Porg.gradle.java.installations.auto-download=false
|
|
|
|
- name: Upload deadlock detector artifacts
|
|
if: always()
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: deadlock-detector-test-${{ matrix.java }}
|
|
path: /tmp/deadlock-detector-*
|
|
if-no-files-found: ignore
|
|
|
|
smoke-test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ windows-latest, ubuntu-latest ]
|
|
suite: [ "glassfish", "jetty", "liberty", "tomcat", "tomee", "wildfly", "other" ]
|
|
fail-fast: false
|
|
steps:
|
|
- name: Support longpaths
|
|
run: git config --system core.longpaths true
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
- uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up JDK 11 for running Gradle
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
- name: Restore cache
|
|
uses: burrunan/gradle-cache-action@v1.10
|
|
with:
|
|
job-id: smokeTests
|
|
|
|
- name: Test
|
|
run: ./gradlew :smoke-tests:test -PsmokeTestSuite=${{ matrix.suite }}
|
|
|
|
setup-muzzle-matrix:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set up JDK 11 for running Gradle
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
- id: set-matrix
|
|
run: echo "::set-output name=matrix::{\"module\":[\"$(./gradlew -q instrumentation:listInstrumentations | xargs echo | sed 's/ /","/g')\"]}"
|
|
|
|
muzzle:
|
|
needs: setup-muzzle-matrix
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix: ${{fromJson(needs.setup-muzzle-matrix.outputs.matrix)}}
|
|
fail-fast: false
|
|
steps:
|
|
- name: Check out repository
|
|
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: Run muzzle
|
|
run: ./gradlew ${{ matrix.module }}:muzzle
|
|
|
|
accept-pr:
|
|
needs: [ build, test, smoke-test, muzzle ]
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
steps:
|
|
# run this action to get workflow conclusion
|
|
# You can get conclusion by env (env.WORKFLOW_CONCLUSION)
|
|
- uses: technote-space/workflow-conclusion-action@v1
|
|
- name: Fail build
|
|
if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure
|
|
run: exit 1 |