Skip to content

Commit c334932

Browse files
committed
build: try matrix for split unit tests
1 parent cbb2a7a commit c334932

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,49 @@ jobs:
4545
env:
4646
JOB_TYPE: test
4747
JOB_NAME: units-${{matrix.java}}
48+
# detect which libraries have changed
49+
changes:
50+
runs-on: ubuntu-latest
51+
permissions:
52+
pull-requests: read
53+
outputs:
54+
packages: ${{ steps.filters.outputs.changes }}
55+
steps:
56+
- uses: dorny/paths-filter@v4
57+
id: filter
58+
with:
59+
filters: |
60+
java-bigquery: java-bigquery
61+
java-bigquerystorage: java-bigquerystorage
62+
java-datastore: java-datastore
63+
split-units:
64+
runs-on: ubuntu-latest
65+
needs: changes
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
java: [11, 17, 21, 25]
70+
package: ${{ fromJSON(needs.changes.outputs.packages) }}
71+
steps:
72+
- name: Get current week within the year
73+
id: date
74+
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
75+
- uses: actions/checkout@v4
76+
- uses: actions/setup-java@v4
77+
with:
78+
distribution: temurin
79+
java-version: ${{matrix.java}}
80+
- run: java -version
81+
- uses: actions/cache@v4
82+
id: mvn-cache
83+
with:
84+
path: ~/.m2/repository
85+
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }}
86+
- run: .kokoro/build.sh
87+
env:
88+
BUILD_SUBDIR: ${{matrix.package}}
89+
JOB_TYPE: test
90+
JOB_NAME: units-${{matrix.package}}-${{matrix.java}}
4891
windows:
4992
runs-on: windows-latest
5093
steps:

0 commit comments

Comments
 (0)