fix tests #561
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
| # test java version of library | |
| name: Test Java | |
| permissions: | |
| contents: read | |
| on: [push] | |
| env: | |
| CODE_CACHE_VERSION: 'code-v1' | |
| M2_CACHE_VERSION: 'm2-v1' | |
| jobs: | |
| compile: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'adopt' | |
| java-version: '17' # maven won't accept --release argument with java < 8; and 11 is next LTS | |
| - id: 'read-cache-maven-packages' | |
| name: Read Cached Maven packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-${{ env.M2_CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }} | |
| - name: Maven compile | |
| run: | | |
| cd java/ | |
| mvn clean compile | |
| - name: Cache compiled classes | |
| # Compiled classes are cached, later restored for tests | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{ github.workspace }}/**/target/**/*.* | |
| key: ${{ runner.os }}-${{ env.CODE_CACHE_VERSION }}-${{ github.ref_name }}-${{ github.sha }} | |
| - id: 'cache-maven-packages' | |
| name: Cache Maven packages | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-${{ env.M2_CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }} | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: compile | |
| strategy: | |
| matrix: | |
| package: [ "com.google.appengine.tools.cloudtasktest.**", | |
| "com.google.appengine.tools.mapreduce.impl.**", | |
| "com.google.appengine.tools.mapreduce.inputs.**", | |
| "com.google.appengine.tools.mapreduce.outputs.**", | |
| "com.google.appengine.tools.mapreduce.*Test", | |
| "com.google.appengine.tools.pipeline.**" ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'adopt' | |
| java-version: '17' # maven won't accept --release argument with java < 8; and 11 is next LTS | |
| - id: 'read-cache-maven-packages' | |
| name: Read Cached Maven packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-${{ env.M2_CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }} | |
| - name: Restore compiled classes from cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/**/target/**/*.* | |
| key: ${{ runner.os }}-${{ env.CODE_CACHE_VERSION }}-${{ github.ref_name }}-${{ github.sha }} | |
| - name: Run Tests for Package ${{ matrix.package }} | |
| env: | |
| APPENGINE_MAPREDUCE_CI_SERVICE_ACCOUNT_KEY: ${{ secrets.APPENGINE_MAPREDUCE_CI_SERVICE_ACCOUNT_KEY }} | |
| run: | | |
| cd java/ | |
| mvn test -T 1C -B -Dtest=${{ matrix.package }} -Dversions.logOutput=false -DprocessDependencies=false -DprocessDependencyManagement=false |