Skip to content

Commit bd9cc81

Browse files
committed
Adding new Java CI file
[skip ci]
1 parent 0b26e3d commit bd9cc81

1 file changed

Lines changed: 270 additions & 0 deletions

File tree

.github/workflows/java-ci.yml

Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
name: Java CI
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '15 9,21 * * *'
6+
7+
env:
8+
NODE_VERSION: '13.x'
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout source tree
15+
uses: actions/checkout@v2
16+
- name: Cache Bazel artifacts
17+
uses: actions/cache@v2
18+
with:
19+
path: |
20+
~/.cache/bazel-disk
21+
~/.cache/bazel-repo
22+
key: ${{ runner.os }}-bazel-build-${{ hashFiles('**/BUILD.bazel') }}
23+
restore-keys: |
24+
${{ runner.os }}-bazel-build-
25+
- name: Setup bazelisk
26+
uses: ./.github/actions/setup-bazelisk
27+
- name: Setup Java
28+
uses: actions/setup-java@v1
29+
with:
30+
java-version: '11'
31+
- name: Build grid
32+
uses: ./.github/actions/bazel
33+
with:
34+
command: build grid
35+
36+
small_tests:
37+
needs: build
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout source tree
41+
uses: actions/checkout@v2
42+
with:
43+
fetch-depth: 0
44+
- name: Cache Bazel artifacts
45+
uses: actions/cache@v2
46+
with:
47+
path: |
48+
~/.cache/bazel-disk
49+
~/.cache/bazel-repo
50+
key: ${{ runner.os }}-bazel-small-tests-${{ hashFiles('**/BUILD.bazel') }}
51+
restore-keys: |
52+
${{ runner.os }}-bazel-small-tests-
53+
${{ runner.os }}-bazel-build-
54+
- name: Setup bazelisk
55+
uses: ./.github/actions/setup-bazelisk
56+
- name: Setup Java
57+
uses: actions/setup-java@v1
58+
with:
59+
java-version: '11'
60+
- name: Run small tests
61+
uses: ./.github/actions/bazel-test
62+
with:
63+
query: attr(size, small, tests(//java/...)) except attr(tags, lint, tests(//java/...))
64+
- name: Sonar Scanner
65+
uses: ./.github/actions/sonar-cloud
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
69+
70+
lint:
71+
needs: build
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Checkout source tree
75+
uses: actions/checkout@v2
76+
- name: Cache Bazel artifacts
77+
uses: actions/cache@v2
78+
with:
79+
path: |
80+
~/.cache/bazel-disk
81+
~/.cache/bazel-repo
82+
key: ${{ runner.os }}-bazel-lint-${{ hashFiles('**/BUILD.bazel') }}
83+
restore-keys: |
84+
${{ runner.os }}-bazel-lint-
85+
${{ runner.os }}-bazel-build-
86+
- name: Setup bazelisk
87+
uses: ./.github/actions/setup-bazelisk
88+
- name: Setup Java
89+
uses: actions/setup-java@v1
90+
with:
91+
java-version: '11'
92+
- name: Run linter
93+
uses: ./.github/actions/bazel-test
94+
with:
95+
query: attr(tags, lint, tests(//java/...))
96+
97+
browser_tests:
98+
needs: small_tests
99+
runs-on: ubuntu-latest
100+
strategy:
101+
fail-fast: false
102+
matrix:
103+
browser: [ chrome, firefox ]
104+
version: [ latest ]
105+
include:
106+
- browser: 'firefox'
107+
version: 'latest-devedition'
108+
- browser: 'firefox'
109+
version: 'latest-beta'
110+
steps:
111+
- name: Checkout source tree
112+
uses: actions/checkout@v2
113+
- name: Cache Bazel artifacts
114+
uses: actions/cache@v2
115+
with:
116+
path: |
117+
~/.cache/bazel-disk
118+
~/.cache/bazel-repo
119+
key: ${{ runner.os }}-bazel-${{ matrix.browser }}-tests-${{ hashFiles('**/BUILD.bazel') }}
120+
restore-keys: |
121+
${{ runner.os }}-bazel-${{ matrix.browser }}-tests-
122+
${{ runner.os }}-bazel-build-
123+
- name: Setup bazelisk
124+
uses: ./.github/actions/setup-bazelisk
125+
- name: Setup Java
126+
uses: actions/setup-java@v1
127+
with:
128+
java-version: '11'
129+
- name: Setup Firefox
130+
uses: browser-actions/setup-firefox@latest
131+
if: |
132+
matrix.browser == 'firefox'
133+
with:
134+
firefox-version: ${{ matrix.version }}
135+
- name: Setup GeckoDriver
136+
uses: browser-actions/setup-geckodriver@latest
137+
if: |
138+
matrix.browser == 'firefox'
139+
- name: Setup Chrome and ChromeDriver
140+
uses: ./.github/actions/setup-chrome
141+
if: |
142+
matrix.browser == 'chrome'
143+
- name: Start XVFB
144+
run: Xvfb :99 &
145+
- name: Run browser tests in ${{ matrix.browser }}
146+
uses: ./.github/actions/bazel-test
147+
with:
148+
query: attr(tags, ${{ matrix.browser }}, tests(//java/...)) except attr(tags, 'lint|rc|remote', tests(//java/...))
149+
attempts: 3
150+
env:
151+
DISPLAY: :99
152+
153+
server_tests:
154+
needs: small_tests
155+
runs-on: ubuntu-latest
156+
strategy:
157+
fail-fast: false
158+
matrix:
159+
browser: [ chrome, firefox ]
160+
version: [ latest ]
161+
include:
162+
- browser: 'firefox'
163+
version: 'latest-devedition'
164+
- browser: 'firefox'
165+
version: 'latest-beta'
166+
steps:
167+
- name: Checkout source tree
168+
uses: actions/checkout@v2
169+
- name: Cache Bazel artifacts
170+
uses: actions/cache@v2
171+
with:
172+
path: |
173+
~/.cache/bazel-disk
174+
~/.cache/bazel-repo
175+
key: ${{ runner.os }}-bazel-${{ matrix.browser }}-server-tests-${{ hashFiles('**/BUILD.bazel') }}
176+
restore-keys: |
177+
${{ runner.os }}-bazel-${{ matrix.browser }}-server-tests-
178+
${{ runner.os }}-bazel-${{ matrix.browser }}-tests-
179+
${{ runner.os }}-bazel-build-
180+
- name: Setup bazelisk
181+
uses: ./.github/actions/setup-bazelisk
182+
- name: Setup Java
183+
uses: actions/setup-java@v1
184+
with:
185+
java-version: '11'
186+
- name: Setup Firefox
187+
uses: browser-actions/setup-firefox@latest
188+
if: |
189+
matrix.browser == 'firefox'
190+
with:
191+
firefox-version: ${{ matrix.version }}
192+
- name: Setup GeckoDriver
193+
uses: browser-actions/setup-geckodriver@latest
194+
if: |
195+
matrix.browser == 'firefox'
196+
- name: Setup Chrome and ChromeDriver
197+
uses: ./.github/actions/setup-chrome
198+
if: |
199+
matrix.browser == 'chrome'
200+
- name: Start XVFB
201+
run: Xvfb :99 &
202+
- name: Run server tests
203+
uses: ./.github/actions/bazel-test
204+
with:
205+
query: attr(tags, ${{ matrix.browser }}, tests(//java/...)) intersect attr(tags, 'remote', tests(//java/...))
206+
attempts: 3
207+
env:
208+
DISPLAY: :99
209+
210+
rc_tests:
211+
needs: small_tests
212+
runs-on: ubuntu-latest
213+
steps:
214+
- name: Checkout source tree
215+
uses: actions/checkout@v2
216+
- name: Cache Bazel artifacts
217+
uses: actions/cache@v2
218+
with:
219+
path: |
220+
~/.cache/bazel-disk
221+
~/.cache/bazel-repo
222+
key: ${{ runner.os }}-bazel-firefox-tests-${{ hashFiles('**/BUILD.bazel') }}
223+
restore-keys: |
224+
${{ runner.os }}-bazel-firefox-tests-
225+
${{ runner.os }}-bazel-build-
226+
- name: Setup bazelisk
227+
uses: ./.github/actions/setup-bazelisk
228+
- name: Setup Java
229+
uses: actions/setup-java@v1
230+
with:
231+
java-version: '11'
232+
- name: Setup Firefox
233+
uses: browser-actions/setup-firefox@latest
234+
- name: Setup GeckoDriver
235+
uses: browser-actions/setup-geckodriver@latest
236+
- name: Start XVFB
237+
run: Xvfb :99 &
238+
- name: Run browser tests in Firefox
239+
uses: ./.github/actions/bazel-test
240+
with:
241+
query: attr(tags, rc, tests(//java/...))
242+
attempts: 3
243+
env:
244+
DISPLAY: :99
245+
246+
javadoc:
247+
needs: build
248+
runs-on: ubuntu-latest
249+
steps:
250+
- name: Checkout source tree
251+
uses: actions/checkout@v2
252+
- name: Cache Bazel artifacts
253+
uses: actions/cache@v2
254+
with:
255+
path: |
256+
~/.cache/bazel-disk
257+
~/.cache/bazel-repo
258+
key: ${{ runner.os }}-bazel-firefox-tests-${{ hashFiles('**/BUILD.bazel') }}
259+
restore-keys: |
260+
${{ runner.os }}-bazel-firefox-tests-
261+
${{ runner.os }}-bazel-build-
262+
- name: Setup bazelisk
263+
uses: ./.github/actions/setup-bazelisk
264+
- name: Setup Java
265+
uses: actions/setup-java@v1
266+
with:
267+
java-version: '11'
268+
- name: Generate javadoc
269+
run: |
270+
./go --verbose javadocs

0 commit comments

Comments
 (0)