171 lines
5.1 KiB
YAML
171 lines
5.1 KiB
YAML
name: Nightly build
|
|
|
|
on:
|
|
schedule:
|
|
# strange schedule to reduce the risk of DDOS GitHub infra
|
|
- cron: "24 3 * * *"
|
|
workflow_dispatch:
|
|
|
|
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: Build
|
|
env:
|
|
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
|
|
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
|
|
run: ./gradlew build --stacktrace -x :smoke-tests:test
|
|
|
|
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
|
|
env:
|
|
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
|
|
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
|
|
run: ./gradlew :smoke-tests:test -PsmokeTestSuite=${{ matrix.suite }}
|
|
|
|
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: Test
|
|
env:
|
|
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
|
|
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
|
|
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
|
|
|
|
testLatestDep:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
- name: Restore cache
|
|
uses: burrunan/gradle-cache-action@v1.10
|
|
with:
|
|
job-id: latestDepTest
|
|
|
|
- name: Test
|
|
env:
|
|
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
|
|
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
|
|
run: ./gradlew test -x :smoke-tests:test -PtestLatestDeps=true --stacktrace
|
|
|
|
snapshot:
|
|
runs-on: ubuntu-latest
|
|
needs: [ build, test, testLatestDep ]
|
|
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: Publish snapshot
|
|
env:
|
|
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
|
|
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
|
|
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
|
|
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
|
|
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
|
|
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
|
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
|
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
|
|
run: ./gradlew snapshot --stacktrace
|
|
|
|
issue:
|
|
name: Open issue on failure
|
|
needs: [ build, test, testLatestDep, snapshot ]
|
|
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
|
|
- uses: actions/checkout@v2.3.4
|
|
- uses: JasonEtco/create-an-issue@v2
|
|
if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
filename: .github/workflows/nightly-failed.md
|