123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309 |
- name: PR build
- on: pull_request
- concurrency:
- group: ci-${{ github.event.pull_request.number }}
- cancel-in-progress: true
- jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - 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: Start deadlock detector
- run: .github/scripts/deadlock-detector.sh
- - name: Build
- uses: gradle/gradle-build-action@v2
- with:
- # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
- arguments: build -x javadoc
- cache-read-only: true
- - name: Upload deadlock detector artifacts if any
- if: always()
- uses: actions/upload-artifact@v2
- with:
- name: deadlock-detector-build
- path: /tmp/deadlock-detector-*
- if-no-files-found: ignore
- - name: Upload jvm crash dump files if any
- if: always()
- uses: actions/upload-artifact@v2
- with:
- name: javacore-build
- path: |
- "**/hs_err_pid*.log"
- "**/javacore.*.txt"
- "**/Snap.*.trc"
- "**/core.*.dmp"
- "**/jitdump.*.dmp"
- if-no-files-found: ignore
- build-gradle-plugins:
- runs-on: ubuntu-latest
- steps:
- - 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: Build
- uses: gradle/gradle-build-action@v2
- with:
- cache-read-only: true
- arguments: build
- build-root-directory: gradle-plugins
- test:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- test-java-version:
- - 8
- - 11
- - 15
- vm:
- - hotspot
- - openj9
- fail-fast: false
- steps:
- - uses: actions/checkout@v2.3.4
- - id: setup-test-java
- name: Set up JDK ${{ matrix.test-java-version }}-${{ matrix.vm }} for running tests
- uses: actions/setup-java@v2
- with:
- distribution: adopt-${{ matrix.vm }}
- java-version: ${{ matrix.test-java-version }}
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: adopt
- java-version: 11
- - name: Start deadlock detector
- run: .github/scripts/deadlock-detector.sh
- - name: Test
- uses: gradle/gradle-build-action@v2
- with:
- arguments: test -PtestJavaVersion=${{ matrix.test-java-version }} -PtestJavaVM=${{ matrix.vm }} -Porg.gradle.java.installations.paths=${{ steps.setup-test-java.outputs.path }} -Porg.gradle.java.installations.auto-download=false
- cache-read-only: true
- - name: Upload deadlock detector artifacts if any
- if: always()
- uses: actions/upload-artifact@v2
- with:
- name: deadlock-detector-test-${{ matrix.test-java-version }}
- path: /tmp/deadlock-detector-*
- if-no-files-found: ignore
- - name: Upload jvm crash dump files if any
- if: always()
- uses: actions/upload-artifact@v2
- with:
- name: javacore-test-${{ matrix.test-java-version }}
- path: |
- "**/hs_err_pid*.log"
- "**/javacore.*.txt"
- "**/Snap.*.trc"
- "**/core.*.dmp"
- "**/jitdump.*.dmp"
- if-no-files-found: ignore
- testLatestDeps:
- # testLatestDeps is not included in the PR workflow by default
- # because any time a new library version is released to maven central
- # it can fail due to test code incompatibility with the new library version,
- # 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)
- #
- # the condition is on the steps below instead of here on the job, because skipping the job
- # causes the job to show up as canceled in the GitHub UI which prevents the build section from
- # collapsing when everything (else) is green
- #
- # and the name is updated when the steps below are skipped which makes what's happening clearer
- # in the GitHub UI
- name: testLatestDeps${{ !contains(github.event.pull_request.labels.*.name, 'test latest deps') && ' (skipped)' || ''}}
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2.3.4
- - name: Set up JDK 11 for running Gradle
- if: ${{ contains(github.event.pull_request.labels.*.name, 'test latest deps') }}
- uses: actions/setup-java@v2
- with:
- distribution: adopt
- java-version: 11
- - name: Test
- if: ${{ contains(github.event.pull_request.labels.*.name, 'test latest deps') }}
- uses: gradle/gradle-build-action@v2
- with:
- arguments: test -PtestLatestDeps=true
- 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 }}"
- setup-muzzle-matrix:
- # release branches are excluded
- # because any time a new library version is released to maven central it can fail
- # which requires unnecessary release branch maintenance, especially for patches
- if: ${{ !startsWith(github.base_ref, 'v') }}
- 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
- - name: List instrumentations to file
- uses: gradle/gradle-build-action@v2
- with:
- arguments: instrumentation:listInstrumentations
- cache-read-only: true
- - id: set-matrix
- run: echo "::set-output name=matrix::{\"module\":[\"$(cat instrumentation-list.txt | 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
- uses: gradle/gradle-build-action@v2
- with:
- arguments: ${{ matrix.module }}:muzzle
- cache-read-only: true
- examples:
- runs-on: ubuntu-latest
- steps:
- - 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: Local publish of artifacts
- uses: gradle/gradle-build-action@v2
- with:
- cache-read-only: true
- # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
- arguments: publishToMavenLocal -x javadoc
- - name: Local publish of gradle plugins
- uses: gradle/gradle-build-action@v2
- with:
- cache-read-only: true
- # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
- arguments: publishToMavenLocal -x javadoc
- build-root-directory: gradle-plugins
- - name: Build distro
- uses: gradle/gradle-build-action@v2
- with:
- cache-read-only: true
- arguments: build --init-script ../../.github/scripts/local.init.gradle.kts
- build-root-directory: examples/distro
- - name: Build extension
- uses: gradle/gradle-build-action@v2
- with:
- cache-read-only: true
- arguments: build --init-script ../../.github/scripts/local.init.gradle.kts
- build-root-directory: examples/extension
- - name: Run muzzle check against extension
- uses: gradle/gradle-build-action@v2
- with:
- cache-read-only: true
- arguments: muzzle --init-script ../../.github/scripts/local.init.gradle.kts
- build-root-directory: examples/extension
- accept-pr:
- needs: [ build, test, smoke-test, muzzle, examples ]
- 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.2
- - name: Fail build
- if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure
- run: exit 1
|