Skip to content

Commit 6a491b1

Browse files
Support for non bzlmod consumption (#210)
* Support for non bzlmod consumption WORKSPACE logic should still work Fixes Support consuming bazel-diff without bzlmod #209 * more updates * more updates * more updates * more updates * more updates * more updates * more updates * more updates * more updates * more updates * updates
1 parent e9befde commit 6a491b1

File tree

9 files changed

+540
-352
lines changed

9 files changed

+540
-352
lines changed

.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
run -c opt --show_loading_progress=false --show_progress=false --ui_event_filters='ERROR'
2-
run:verbose -c dbg --show_loading_progress=true --show_progress=true --ui_event_filters='INFO,ERROR,DEBUG'
1+
run -c opt --show_loading_progress=false --show_progress=false --ui_event_filters=error
2+
run:verbose -c dbg --show_loading_progress=true --show_progress=true --ui_event_filters=info,error,debug
33
# https://github.com/mockito/mockito/issues/1879
44
test --sandbox_tmpfs_path=/tmp

.github/workflows/ci.yaml

Lines changed: 6 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
test-jre8:
10+
test-jre11-bzlmod:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Setup Java JDK
1414
uses: actions/setup-java@v3
1515
with:
1616
distribution: 'temurin'
17-
java-version: '8'
18-
id: java
17+
java-version: '11'
1918
- name: Setup Go environment
2019
uses: actions/setup-go@v3
2120
with:
@@ -25,37 +24,7 @@ jobs:
2524
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
2625
- uses: actions/checkout@v3
2726
- name: Run bazel-diff tests
28-
run: ~/go/bin/bazelisk test //cli/...
29-
- name: archive testlogs
30-
if: always()
31-
run: cp -R $(~/go/bin/bazelisk info bazel-testlogs) ./test-logs; (cd test-logs; zip -r -X ../test-logs.zip .)
32-
- name: Save test logs
33-
uses: actions/upload-artifact@master
34-
if: always()
35-
with:
36-
name: test-logs-jre8
37-
path: test-logs.zip
38-
test-jre8-run-example:
39-
runs-on: ubuntu-latest
40-
steps:
41-
- name: Setup Java JDK
42-
uses: actions/setup-java@v3
43-
with:
44-
distribution: 'temurin'
45-
java-version: '8'
46-
id: java
47-
- name: Setup Go environment
48-
uses: actions/setup-go@v3
49-
with:
50-
go-version: ^1.17
51-
id: go
52-
- name: Setup Bazelisk
53-
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
54-
- uses: actions/checkout@v3
55-
with:
56-
fetch-depth: 0
57-
- name: Run bazel-diff example script
58-
run: ./bazel-diff-example.sh "$GITHUB_WORKSPACE" ~/go/bin/bazelisk $(git rev-parse HEAD~1) $(git rev-parse HEAD)
27+
run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/... --enable_bzlmod=true
5928
test-jre11:
6029
runs-on: ubuntu-latest
6130
steps:
@@ -73,16 +42,7 @@ jobs:
7342
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
7443
- uses: actions/checkout@v3
7544
- name: Run bazel-diff tests
76-
run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/...
77-
- name: archive testlogs
78-
if: always()
79-
run: cp -R $(~/go/bin/bazelisk info bazel-testlogs) ./test-logs; (cd test-logs; zip -r -X ../test-logs.zip .)
80-
- name: Save test logs
81-
uses: actions/upload-artifact@master
82-
if: always()
83-
with:
84-
name: test-logs-jre11
85-
path: test-logs.zip
45+
run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/... --enable_bzlmod=false
8646
test-jre11-run-example:
8747
runs-on: ubuntu-latest
8848
steps:
@@ -105,11 +65,11 @@ jobs:
10565
- name: Run bazel-diff example script
10666
run: ./bazel-diff-example.sh "$GITHUB_WORKSPACE" ~/go/bin/bazelisk $(git rev-parse HEAD~1) $(git rev-parse HEAD)
10767
deploy:
108-
needs: [test-jre8, test-jre11]
68+
needs: [test-jre11]
10969
runs-on: ubuntu-latest
11070
strategy:
11171
matrix:
112-
java: [ '8' ]
72+
java: [ '11' ]
11373
steps:
11474
- name: Setup Java JDK
11575
uses: actions/setup-java@v3

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
bazel_dep(name = "bazel_skylib", version = "1.5.0")
99
bazel_dep(name = "rules_proto", version = "6.0.0-rc2")
10+
bazel_dep(name = "rules_java", version = "7.5.0")
1011
bazel_dep(name = "rules_kotlin", version = "1.9.1")
1112
bazel_dep(name = "rules_jvm_external", version = "6.0")
1213

0 commit comments

Comments
 (0)