-
Notifications
You must be signed in to change notification settings - Fork 59
162 lines (160 loc) · 5.17 KB
/
ci.yaml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test-jre8-bzlmod:
runs-on: ubuntu-latest
steps:
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
id: java
- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: ^1.17
id: go
- name: Setup Bazelisk
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
- uses: actions/checkout@v3
- name: Run bazel-diff tests
run: ~/go/bin/bazelisk test //cli/... --enable_bzlmod
- name: archive testlogs
if: always()
run: cp -R $(~/go/bin/bazelisk info bazel-testlogs) ./test-logs; (cd test-logs; zip -r -X ../test-logs.zip .)
- name: Save test logs
uses: actions/upload-artifact@master
if: always()
with:
name: test-logs-jre8
path: test-logs.zip
test-jre8:
runs-on: ubuntu-latest
steps:
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
id: java
- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: ^1.17
id: go
- name: Setup Bazelisk
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
- uses: actions/checkout@v3
- name: Run bazel-diff tests
run: ~/go/bin/bazelisk test //cli/... --enable_bzlmod=false
- name: archive testlogs
if: always()
run: cp -R $(~/go/bin/bazelisk info bazel-testlogs) ./test-logs; (cd test-logs; zip -r -X ../test-logs.zip .)
- name: Save test logs
uses: actions/upload-artifact@master
if: always()
with:
name: test-logs-jre8
path: test-logs.zip
test-jre8-run-example:
runs-on: ubuntu-latest
steps:
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
id: java
- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: ^1.17
id: go
- name: Setup Bazelisk
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run bazel-diff example script
run: ./bazel-diff-example.sh "$GITHUB_WORKSPACE" ~/go/bin/bazelisk $(git rev-parse HEAD~1) $(git rev-parse HEAD)
test-jre11:
runs-on: ubuntu-latest
steps:
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: ^1.17
id: go
- name: Setup Bazelisk
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
- uses: actions/checkout@v3
- name: Run bazel-diff tests
run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/...
- name: archive testlogs
if: always()
run: cp -R $(~/go/bin/bazelisk info bazel-testlogs) ./test-logs; (cd test-logs; zip -r -X ../test-logs.zip .)
- name: Save test logs
uses: actions/upload-artifact@master
if: always()
with:
name: test-logs-jre11
path: test-logs.zip
test-jre11-run-example:
runs-on: ubuntu-latest
steps:
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
id: java
- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: ^1.17
id: go
- name: Setup Bazelisk
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run bazel-diff example script
run: ./bazel-diff-example.sh "$GITHUB_WORKSPACE" ~/go/bin/bazelisk $(git rev-parse HEAD~1) $(git rev-parse HEAD)
deploy:
needs: [test-jre8, test-jre11]
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8' ]
steps:
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
id: java
- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: ^1.17
id: go
- name: Setup Bazelisk
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
- uses: actions/checkout@v3
- name: Build deployable JAR
run: ~/go/bin/bazelisk build //cli:bazel-diff_deploy.jar
- uses: actions/upload-artifact@v3
with:
name: bazel-diff_deploy.jar
path: bazel-bin/cli/bazel-diff_deploy.jar
if-no-files-found: error