| name: Tests |
| |
| on: |
| push: |
| branches: [ master ] |
| |
| pull_request: |
| branches: [ master ] |
| |
| jobs: |
| build: |
| runs-on: ubuntu-18.04 |
| |
| steps: |
| - uses: actions/checkout@v2 |
| |
| - uses: actions/cache@v2 |
| with: |
| path: | |
| ~/.gradle |
| ~/.m2 |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| restore-keys: | |
| ${{ runner.os }}-gradle- |
| |
| - name: Set up JDK 11.0.8 |
| uses: actions/setup-java@v1 |
| with: |
| java-version: 11.0.8 |
| |
| - name: Build |
| run: SKIP_JAVADOC=true ./gradlew clean assemble testClasses --parallel --stacktrace |
| |
| tests: |
| runs-on: ubuntu-18.04 |
| needs: build |
| strategy: |
| fail-fast: false |
| matrix: |
| api-versions: ['16,17,18', '19,21,22', '23,24,25', '26,27,28', '29,30'] |
| |
| steps: |
| - uses: actions/checkout@v2 |
| |
| - uses: actions/cache@v2 |
| with: |
| path: | |
| ~/.gradle |
| ~/.m2 |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| restore-keys: | |
| ${{ runner.os }}-gradle- |
| |
| - name: Set up JDK 11.0.8 |
| uses: actions/setup-java@v1 |
| with: |
| java-version: 11.0.8 |
| |
| - name: Run tests |
| run: | |
| ./gradlew test --info --stacktrace --continue \ |
| --parallel \ |
| -Drobolectric.enabledSdks=${{ matrix.api-versions }} \ |
| -Drobolectric.alwaysIncludeVariantMarkersInTestName=true \ |
| -Dorg.gradle.workers.max=2 |
| |
| - name: Upload Test Results |
| uses: actions/upload-artifact@v2 |
| if: always() |
| with: |
| name: test_results_${{ matrix.api-versions }} |
| path: '**/build/test-results/**/TEST-*.xml' |