Skip to content

Commit 99c1ffb

Browse files
committed
chore(java-logging): migrate and adapt GitHub Actions workflows
1 parent d8aa6aa commit 99c1ffb

File tree

1 file changed

+140
-0
lines changed

1 file changed

+140
-0
lines changed
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# Github action job to test core java library features on
15+
# downstream client libraries before they are released.
16+
on:
17+
push:
18+
branches:
19+
- main
20+
pull_request:
21+
name: java-logging ci
22+
env:
23+
BUILD_SUBDIR: java-logging
24+
jobs:
25+
filter:
26+
runs-on: ubuntu-latest
27+
outputs:
28+
library: ${{ steps.filter.outputs.library }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: dorny/paths-filter@v3
32+
id: filter
33+
with:
34+
filters: |
35+
library:
36+
- 'java-logging/**'
37+
units:
38+
needs: filter
39+
if: ${{ needs.filter.outputs.library == 'true' }}
40+
runs-on: ubuntu-latest
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
java: [11, 17, 21, 25]
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: actions/setup-java@v4
48+
with:
49+
distribution: temurin
50+
java-version: ${{matrix.java}}
51+
- run: java -version
52+
- run: .kokoro/build.sh
53+
env:
54+
JOB_TYPE: test
55+
units-java8:
56+
needs: filter
57+
if: ${{ needs.filter.outputs.library == 'true' }}
58+
# Building using Java 17 and run the tests with Java 8 runtime
59+
name: "units (8)"
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: actions/setup-java@v4
64+
with:
65+
java-version: 8
66+
distribution: temurin
67+
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
68+
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
69+
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
70+
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java -P !java17" >> $GITHUB_ENV
71+
shell: bash
72+
- uses: actions/setup-java@v4
73+
with:
74+
java-version: 17
75+
distribution: temurin
76+
- run: .kokoro/build.sh
77+
env:
78+
JOB_TYPE: test
79+
windows:
80+
needs: filter
81+
if: ${{ needs.filter.outputs.library == 'true' }}
82+
runs-on: windows-latest
83+
steps:
84+
- name: Support longpaths
85+
run: git config --system core.longpaths true
86+
working-directory: .
87+
- name: Support longpaths
88+
run: git config --system core.longpaths true
89+
- uses: actions/checkout@v4
90+
- uses: actions/setup-java@v4
91+
with:
92+
distribution: temurin
93+
java-version: 8
94+
- run: java -version
95+
- run: .kokoro/build.bat
96+
env:
97+
JOB_TYPE: test
98+
dependencies:
99+
needs: filter
100+
if: ${{ needs.filter.outputs.library == 'true' }}
101+
runs-on: ubuntu-latest
102+
strategy:
103+
matrix:
104+
java: [17]
105+
steps:
106+
- uses: actions/checkout@v4
107+
- uses: actions/setup-java@v4
108+
with:
109+
distribution: temurin
110+
java-version: ${{matrix.java}}
111+
- run: java -version
112+
- run: .kokoro/dependencies.sh
113+
javadoc:
114+
needs: filter
115+
if: ${{ needs.filter.outputs.library == 'true' }}
116+
runs-on: ubuntu-latest
117+
steps:
118+
- uses: actions/checkout@v4
119+
- uses: actions/setup-java@v4
120+
with:
121+
distribution: temurin
122+
java-version: 17
123+
- run: java -version
124+
- run: .kokoro/build.sh
125+
env:
126+
JOB_TYPE: javadoc
127+
lint:
128+
needs: filter
129+
if: ${{ needs.filter.outputs.library == 'true' }}
130+
runs-on: ubuntu-latest
131+
steps:
132+
- uses: actions/checkout@v4
133+
- uses: actions/setup-java@v4
134+
with:
135+
distribution: temurin
136+
java-version: 17
137+
- run: java -version
138+
- run: .kokoro/build.sh
139+
env:
140+
JOB_TYPE: lint

0 commit comments

Comments
 (0)