-
-
Notifications
You must be signed in to change notification settings - Fork 8
62 lines (54 loc) · 1.44 KB
/
ci.yml
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
name: CI
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
setup-bazel:
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os:
- macos
- ubuntu
- windows
steps:
- name: Checkout example
uses: actions/checkout@v4
with:
repository: bazelbuild/examples
sparse-checkout: java-maven
sparse-checkout-cone-mode: false
- name: Checkout setup-bazel
uses: actions/checkout@v4
with:
path: setup-bazel
- name: Prepare environment (POSIX)
if: matrix.os != 'windows'
run: |
rm $(which bazel)
shopt -s dotglob
mv java-maven/* .
rmdir java-maven
- name: Prepare environment (Windows)
if: matrix.os == 'windows'
run: |
Remove-Item -Path (Get-Command bazel.exe).Source
Get-ChildItem -Path java-maven -Recurse -File | Move-Item -Destination .
- name: Setup Bazel
uses: ./setup-bazel/
with:
bazelisk-cache: true
bazelisk-version: 1.x
remote-cache: true
repository-cache: true
- run: bazel build ...
- run: bazel test ...
- name: Start SSH session
if: failure() && runner.debug == '1'
uses: mxschmitt/action-tmate@v3