1name: Nightly 2on: 3 workflow_dispatch: 4 schedule: 5 - cron: '0 1 * * *' # Nightly at 1am 6defaults: 7 run: 8 shell: bash 9jobs: 10 nightly: 11 strategy: 12 fail-fast: false 13 matrix: 14 os: [ macOS-12, ubuntu-22.04, windows-2022 ] 15 java: [ 11, 17 ] 16 runs-on: ${{ matrix.os }} 17 steps: 18 - run: git config --global core.longpaths true 19 - uses: actions/checkout@v3 20 - uses: actions/setup-java@v3 21 with: 22 java-version: ${{ matrix.java }} 23 distribution: temurin 24 cache: maven 25 - run: mvn -version 26 - name: Unit Tests 27 run: mvn install --errors --batch-mode --no-transfer-progress -Dcheckstyle.skip -T 1C 28 - name: Create issue if previous step fails 29 if: ${{ failure() }} 30 env: 31 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 32 run: | 33 gh issue create \ 34 --title "Nightly build for Java ${{ matrix.java }} on ${{ matrix.os }} failed." \ 35 --body "The build has failed : https://github.com/googleapis/gapic-generator-java/actions/runs/${GITHUB_RUN_ID}" 36 nightly-java8: # Compile with JDK 11. Run tests with JDK 8. 37 strategy: 38 fail-fast: false 39 matrix: 40 os: [ macOS-12, ubuntu-22.04, windows-2022 ] 41 runs-on: ${{ matrix.os }} 42 steps: 43 - run: git config --global core.longpaths true 44 - uses: actions/checkout@v3 45 - uses: actions/setup-java@v3 46 with: 47 java-version: 11 48 distribution: temurin 49 cache: maven 50 - run: mvn -version 51 - name: Install with Java 11 52 run: mvn install --errors --batch-mode --no-transfer-progress -Dcheckstyle.skip -DskipTests -T 1C 53 54 - uses: actions/setup-java@v3 55 with: 56 java-version: 8 57 distribution: temurin 58 cache: maven 59 - run: mvn -version 60 - name: Test with Java 8 61 # Direct goal invocation ("surefire:test") prevents recompiling tests 62 run: mvn surefire:test --errors --batch-mode --no-transfer-progress -T 1C 63 - name: Create issue if previous step fails 64 if: ${{ failure() }} 65 env: 66 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 67 run: | 68 gh issue create \ 69 --title "Nightly-java8 build on ${{ matrix.os }} failed." \ 70 --body "The build has failed : https://github.com/googleapis/gapic-generator-java/actions/runs/${GITHUB_RUN_ID}" 71