Build CI #37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| types: [opened, synchronize] | |
| branches: [main] | |
| env: | |
| GRADLE_OPTS: "-Dorg.gradle.daemon=false" | |
| jobs: | |
| build: | |
| name: Build Java ${{ matrix.java }} (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java: [ '11' ] | |
| os: [ 'ubuntu-latest', 'windows-latest'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Cache gradle dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.gradle/caches | |
| key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle-caches- | |
| - name: Cache gradle wrapper | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
| - name: Setup java | |
| uses: actions/setup-java@v1 | |
| with: | |
| java-version: ${{ matrix.java }} | |
| - name: Build with gradle | |
| run: ./gradlew build | |
| - name: Upload test results | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-report-${{ matrix.os }}-${{ matrix.java }} | |
| path: | | |
| **/build/reports/tests/test/** | |
| **/build/test-results/test/*.xml |