name: Nightly build without cache on: schedule: # strange schedule to reduce the risk of DDOS GitHub infra - cron: "48 4 * * *" 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 Gradle uses: actions/setup-java@v2 with: distribution: adopt java-version: 11 - name: Cache Gradle Wrapper uses: actions/cache@v2 with: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - name: Build run: ./gradlew build --stacktrace --no-build-cache build-gradle-plugins: runs-on: ubuntu-latest steps: - 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: Cache Gradle Wrapper uses: actions/cache@v2 with: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - name: Build run: ../gradlew build --stacktrace --no-build-cache working-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 with: fetch-depth: 0 - 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: Cache Gradle Wrapper uses: actions/cache@v2 with: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - name: Test run: ./gradlew test -PtestJavaVersion=${{ matrix.test-java-version }} -PtestJavaVM=${{ matrix.vm }} --stacktrace -Porg.gradle.java.installations.paths=${{ steps.setup-test-java.outputs.path }} -Porg.gradle.java.installations.auto-download=false --no-build-cache testLatestDeps: runs-on: ubuntu-latest steps: - 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: Cache Gradle Wrapper uses: actions/cache@v2 with: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - name: Test run: ./gradlew test -PtestLatestDeps=true --stacktrace --no-build-cache smoke-test: runs-on: ${{ matrix.os }} strategy: matrix: os: - windows-latest - ubuntu-latest smoke-test-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: Cache Gradle Wrapper uses: actions/cache@v2 with: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - name: Test # using --no-daemon because windows builds have been sporadically running out of virtual memory run: ./gradlew :smoke-tests:test -PsmokeTestSuite=${{ matrix.smoke-test-suite }} --no-build-cache --no-daemon # muzzle 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 examples: runs-on: ubuntu-latest steps: - 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: Cache Gradle Wrapper uses: actions/cache@v2 with: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('examples/distro/gradle/wrapper/gradle-wrapper.properties') }} - name: Local publish run: ./gradlew publishToMavenLocal --no-build-cache - 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 issue: name: Open issue on failure needs: [ build, test, testLatestDeps, smoke-test, 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.1.7 - uses: actions/checkout@v2.3.4 with: fetch-depth: 0 - uses: JasonEtco/create-an-issue@v2.5.0 if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: filename: .github/workflows/nightly-failed.md