First draft of nightly build job for master branch
ADD
.github/workflows/nightly.yaml
+name: Nightly build
+
+on:
+ push:
+ branches:
+ - master
+ schedule:
+ # strange schedule to reduce the risk of DDOS GitHub infra
+ - cron: "24 3 * * *"
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Set current date as env variable
+ run: echo "::set-env name=TODAY::$(date +'%Y-%m-%d')"
+
+ - name: Cache gradle dependencies
+ uses: actions/cache@v2
+ env:
+ cache-name: cache-gradle
+ with:
+ path: ~/.gradle
+ # Every night we refresh cache with dependencies and class compilation results.
+ # Gradle build files can change for a variety of reasons, no need to invalidate cache.
+ # TODO cache test results as well
+ # TODO replace/augment with remote gradle cache
+ key: build-${{ env.cache-name }}-${{ env.TODAY }}
+ restore-keys: |
+ build-${{ env.cache-name }}-
+
+ - name: Build with Gradle
+ run: ./gradlew assemble testClasses
+
+ test:
+ needs: build
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ java: [8, 11, 14]
+ fail-fast: false
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK ${{ matrix.java }} for running tests
+ uses: actions/setup-java@v1
+ with:
+ java-version: ${{ matrix.java }}
+ - name: Set JDK ${{ matrix.java }} home
+ run: echo "::set-env name=JAVA_${{ matrix.java }}_HOME::${{ env.JAVA_HOME }}"
+
+ - name: Set up JDK 11 for running Gradle
+ if: matrix.java != 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+
+ - name: Set current date as env variable
+ run: echo "::set-env name=TODAY::$(date +'%Y-%m-%d')"
+
+ - name: Cache gradle dependencies
+ uses: actions/cache@v2
+ env:
+ cache-name: cache-gradle
+ with:
+ path: ~/.gradle
+ key: build-${{ env.cache-name }}-${{ env.TODAY }}
+ restore-keys: |
+ build-${{ env.cache-name }}-
+
+ - name: Test with Gradle
+ run: ./gradlew testJava${{ matrix.java }}
+
+ testLatestDep:
+ needs: build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+
+ - name: Set current date as env variable
+ run: echo "::set-env name=TODAY::$(date +'%Y-%m-%d')"
+
+ - name: Cache gradle dependencies
+ uses: actions/cache@v2
+ env:
+ cache-name: cache-gradle
+ with:
+ path: ~/.gradle
+ key: build-${{ env.cache-name }}-${{ env.TODAY }}
+ restore-keys: |
+ build-${{ env.cache-name }}-
+
+ - name: Test with Gradle
+ run: ./gradlew latestDepTest
\ No newline at end of file

First draft of nightly build job for master branch (#775)