-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (88 loc) · 3.36 KB
/
Copy pathtest-java.yml
File metadata and controls
91 lines (88 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# 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@v6
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
- id: 'read-cache-maven-packages'
name: Read Cached Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-${{ env.M2_CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-${{ env.M2_CACHE_VERSION }}-
- 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@v5
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@v5
with:
path: ~/.m2
key: ${{ runner.os }}-${{ env.M2_CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }}
test:
name: test (${{ matrix.name }})
runs-on: ubuntu-latest
needs: compile
strategy:
fail-fast: true
matrix:
include:
- name: cloudtasktest
package: "com.google.appengine.tools.cloudtasktest.**"
- name: mapreduce-impl-N-to-Z
package: "!%regex[com\\.google\\.appengine\\.tools\\.mapreduce\\.impl\\.([a-z]+\\.)*[A-M].+]"
- name: mapreduce-impl-A-to-M
package: "!%regex[com\\.google\\.appengine\\.tools\\.mapreduce\\.impl\\.([a-z]+\\.)*[N-Z].+]"
- name: mapreduce-inputs
package: "com.google.appengine.tools.mapreduce.inputs.**"
- name: mapreduce-outputs
package: "com.google.appengine.tools.mapreduce.outputs.**"
- name: mapreduce-top-level
package: "com.google.appengine.tools.mapreduce.*Test"
- name: pipeline
package: "com.google.appengine.tools.pipeline.**"
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: '21' # 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@v5
with:
path: ~/.m2
key: ${{ runner.os }}-${{ env.M2_CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-${{ env.M2_CACHE_VERSION }}-
- name: Restore compiled classes from cache
uses: actions/cache@v5
with:
path: ${{ github.workspace }}/**/target/**/*.*
key: ${{ runner.os }}-${{ env.CODE_CACHE_VERSION }}-${{ github.ref_name }}-${{ github.sha }}
- name: Run Tests for Package ${{ matrix.name }}
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