Skip to content

Commit 892ca45

Browse files
Adds matrix based testing for example script using various bazel versions (#300)
* Adds matrix based testing for example script using various bazel versions Enhances this testing across bazel versions * remove bazel 9 for now * more updates * flag update * more updates * more updates * bump bazelversion * flags * default to bzlmod * only 8 for external test * test * more test fixes * lock * more updates * update more github actions * remove no impacted targets test * upload logs * update java * more test updates * more e2e fixes * more updates * updates to actions * enhance e2e test debugging * filtering for bazel-dfif targets in e2e
1 parent 4ff25af commit 892ca45

30 files changed

+741
-1802
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.3.2
1+
8.5.1

.github/workflows/ci.yaml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
test-jre21-bzlmod:
10+
test-jre21:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Setup Java JDK
@@ -24,27 +24,26 @@ jobs:
2424
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
2525
- uses: actions/checkout@v4
2626
- name: Run bazel-diff tests
27-
run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/... --enable_bzlmod=true
28-
test-jre21:
29-
runs-on: ubuntu-latest
30-
steps:
31-
- name: Setup Java JDK
32-
uses: actions/setup-java@v4
27+
run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/... --enable_bzlmod=true --enable_workspace=false
28+
- name: Upload coverage report
29+
uses: actions/upload-artifact@v4
30+
if: always()
3331
with:
34-
distribution: 'temurin'
35-
java-version: '21'
36-
- name: Setup Go environment
37-
uses: actions/setup-go@v5
32+
name: coverage-report-jre21
33+
path: bazel-out/_coverage/_coverage_report.dat
34+
if-no-files-found: warn
35+
- name: Upload test logs
36+
uses: actions/upload-artifact@v4
37+
if: always()
3838
with:
39-
go-version: ^1.17
40-
id: go
41-
- name: Setup Bazelisk
42-
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
43-
- uses: actions/checkout@v4
44-
- name: Run bazel-diff tests
45-
run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/... --enable_bzlmod=false
39+
name: test-logs-jre21
40+
path: bazel-testlogs/
41+
if-no-files-found: warn
4642
test-jre11-run-example:
4743
runs-on: ubuntu-latest
44+
strategy:
45+
matrix:
46+
bazel: ['7.x', '8.x']
4847
steps:
4948
- name: Setup Java JDK
5049
uses: actions/setup-java@v4
@@ -63,6 +62,10 @@ jobs:
6362
with:
6463
fetch-depth: 0
6564
- name: Run bazel-diff example script
65+
env:
66+
USE_BAZEL_VERSION: ${{ matrix.bazel }}
67+
BAZEL_DIFF_DISABLE_WORKSPACE: ${{ matrix.bazel == '8.x' && 'true' || 'false' }}
68+
BAZEL_DIFF_FORCE_CHECKOUT: true
6669
run: ./bazel-diff-example.sh "$GITHUB_WORKSPACE" ~/go/bin/bazelisk $(git rev-parse HEAD~1) $(git rev-parse HEAD)
6770
deploy:
6871
needs: [test-jre21]

.github/workflows/integration_external_target.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
java: [ '8', '11' ]
16+
java: [ '11' ]
17+
bazel: ['8.x']
1718
steps:
1819
- name: Setup Java JDK
1920
uses: actions/setup-java@v3
@@ -26,9 +27,21 @@ jobs:
2627
repository: tinder-maxwellelliott/bazel-diff-repro-1
2728
ref: master
2829
fetch-depth: 0
29-
- name: Set bazel version
30-
run: echo "USE_BAZEL_VERSION=7.3.1" > "$HOME/.bazeliskrc"
3130
- name: Run External Target Impact test
31+
env:
32+
USE_BAZEL_VERSION: ${{ matrix.bazel }}
33+
BAZEL_DIFF_DISABLE_WORKSPACE: ${{ matrix.bazel == '8.x' && 'true' || 'false' }}
34+
BAZEL_DIFF_FORCE_CHECKOUT: true
3235
run: ./bazel-diff.sh $(pwd) bazel $(git rev-parse HEAD~1) $(git rev-parse HEAD)
3336
- name: Validate Impacted Targets
3437
run: grep -q "//:yo" /tmp/impacted_targets.txt
38+
- name: Upload bazel-diff artifacts
39+
if: always()
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: bazel-diff-artifacts-java-${{ matrix.java }}-bazel-${{ matrix.bazel }}
43+
path: |
44+
/tmp/impacted_targets.txt
45+
/tmp/bazel-diff*.log
46+
/tmp/bazel-diff*.json
47+
if-no-files-found: warn

.github/workflows/integration_no_impacted_targets.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

MODULE.bazel

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
module(
22
name = "bazel-diff",
3-
version = "12.1.1",
3+
version = "13.0.0",
44
compatibility_level = 0,
55
)
66

77
bazel_dep(name = "rules_license", version = "1.0.0", dev_dependency = True)
88
bazel_dep(name = "aspect_rules_lint", version = "1.0.2", dev_dependency = True)
9+
910
bazel_dep(name = "bazel_skylib", version = "1.7.1")
1011
bazel_dep(name = "rules_proto", version = "7.1.0")
11-
bazel_dep(name = "rules_java", version = "8.11.0")
12+
bazel_dep(name = "rules_java", version = "8.14.0")
1213
bazel_dep(name = "rules_kotlin", version = "2.1.3")
1314
bazel_dep(name = "rules_jvm_external", version = "6.7")
1415

0 commit comments

Comments
 (0)