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 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 # testLatestDep is intentionally not included in the PR workflow # because any time a new library version is released to maven central # it can fail due to test code incompatibility with the new release, # or due to slight changes in emitted telemetry, which can be confusing for contributors # (muzzle can also fail when a new library version is released to maven central # but that happens much less often) 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 with: fetch-depth: 0 - name: Set up JDK 11 for running Gradle uses: actions/setup-java@v2 with: distribution: adopt java-version: 11 - name: Run muzzle # using retry because of sporadic gradle download failures uses: nick-invision/retry@v2.4.0 with: # timing out has not been a problem, these jobs typically finish in 2-3 minutes timeout_minutes: 15 max_attempts: 3 command: ./gradlew ${{ matrix.module }}:muzzle 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 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@v2.1.6 - name: Fail build if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure run: exit 1