Skip to content

Commit 48889e6

Browse files
committed
chore(java-bigquerystorage): migrate and adapt GitHub Actions workflows
1 parent e457fd2 commit 48889e6

1 file changed

Lines changed: 123 additions & 0 deletions

File tree

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
on:
2+
push:
3+
paths-ignore:
4+
- 'tutorials/**'
5+
branches:
6+
- main
7+
pull_request:
8+
name: java-bigquerystorage ci
9+
defaults:
10+
run:
11+
working-directory: java-bigquerystorage
12+
jobs:
13+
filter:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
library: ${{ steps.filter.outputs.library }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: dorny/paths-filter@v3
20+
id: filter
21+
with:
22+
filters: |
23+
library:
24+
- 'java-bigquerystorage/**'
25+
units:
26+
needs: filter
27+
if: ${{ needs.filter.outputs.library == 'true' }}
28+
runs-on: ubuntu-latest
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
java: [11, 17, 21, 25]
33+
steps:
34+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
35+
- uses: actions/setup-java@v2
36+
with:
37+
distribution: temurin
38+
java-version: ${{matrix.java}}
39+
- run: java -version
40+
- run: .kokoro/build.sh
41+
env:
42+
JOB_TYPE: test
43+
units-java8:
44+
needs: filter
45+
if: ${{ needs.filter.outputs.library == 'true' }}
46+
# Building using Java 17 and run the tests with Java 8 runtime
47+
name: "units (8)"
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
51+
- uses: actions/setup-java@v3
52+
with:
53+
java-version: 8
54+
distribution: zulu
55+
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
56+
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
57+
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
58+
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV
59+
shell: bash
60+
- uses: actions/setup-java@v3
61+
with:
62+
java-version: 17
63+
distribution: zulu
64+
- run: .kokoro/build.sh
65+
env:
66+
JOB_TYPE: test
67+
windows:
68+
needs: filter
69+
if: ${{ needs.filter.outputs.library == 'true' }}
70+
runs-on: windows-latest
71+
steps:
72+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
73+
- uses: actions/setup-java@v2
74+
with:
75+
distribution: temurin
76+
java-version: 8
77+
- run: java -version
78+
- run: .kokoro/build.bat
79+
env:
80+
JOB_TYPE: test
81+
dependencies:
82+
needs: filter
83+
if: ${{ needs.filter.outputs.library == 'true' }}
84+
runs-on: ubuntu-latest
85+
strategy:
86+
matrix:
87+
java: [17]
88+
steps:
89+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
90+
- uses: actions/setup-java@v2
91+
with:
92+
distribution: temurin
93+
java-version: ${{matrix.java}}
94+
- run: java -version
95+
- run: .kokoro/dependencies.sh
96+
javadoc:
97+
needs: filter
98+
if: ${{ needs.filter.outputs.library == 'true' }}
99+
runs-on: ubuntu-latest
100+
steps:
101+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
102+
- uses: actions/setup-java@v3
103+
with:
104+
distribution: temurin
105+
java-version: 17
106+
- run: java -version
107+
- run: .kokoro/build.sh
108+
env:
109+
JOB_TYPE: javadoc
110+
lint:
111+
needs: filter
112+
if: ${{ needs.filter.outputs.library == 'true' }}
113+
runs-on: ubuntu-latest
114+
steps:
115+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
116+
- uses: actions/setup-java@v2
117+
with:
118+
distribution: temurin
119+
java-version: 17
120+
- run: java -version
121+
- run: .kokoro/build.sh
122+
env:
123+
JOB_TYPE: lint

0 commit comments

Comments
 (0)