Skip to content

Commit ac02731

Browse files
More BCR updates (#312)
* More BCR updates Adds more testing support to match our BCR testing flow * more updates * more updates * more updates * more updates * update ci * more test fixes
1 parent c21996d commit ac02731

File tree

11 files changed

+962
-522
lines changed

11 files changed

+962
-522
lines changed

.bazelrc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@ test --sandbox_tmpfs_path=/tmp
66
# Use a hermetic JDK for tests.
77
common --java_runtime_version=remotejdk_21
88

9+
# Enable platform-specific config
10+
common --enable_platform_specific_config
11+
912
# Set C++ standard to C++17 for abseil-cpp compatibility
10-
build --cxxopt=-std=c++17
11-
build --host_cxxopt=-std=c++17
13+
# Use GCC/Clang syntax for Linux and macOS
14+
build:linux --cxxopt=-std=c++17
15+
build:linux --host_cxxopt=-std=c++17
16+
build:macos --cxxopt=-std=c++17
17+
build:macos --host_cxxopt=-std=c++17
18+
# Use MSVC syntax for Windows
19+
build:windows --cxxopt=/std:c++17
20+
build:windows --host_cxxopt=/std:c++17
1221

1322
# Avoid cache thrashing, but allow integration tests to find "bazel" on the PATH.
1423
common --incompatible_strict_action_env

.github/workflows/ci.yaml

Lines changed: 65 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,19 @@ on:
88

99
jobs:
1010
test-jre21:
11-
runs-on: ubuntu-latest
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- os: ubuntu-latest
17+
bazel: '8.x'
18+
- os: ubuntu-latest
19+
bazel: '9.x'
20+
- os: macos-latest
21+
bazel: '8.x'
22+
- os: macos-latest
23+
bazel: '9.x'
1224
steps:
1325
- name: Setup Java JDK
1426
uses: actions/setup-java@v4
@@ -24,48 +36,67 @@ jobs:
2436
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
2537
- uses: actions/checkout@v4
2638
- name: Run bazel-diff tests
39+
env:
40+
USE_BAZEL_VERSION: ${{ matrix.bazel }}
2741
run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/... --enable_bzlmod=true --enable_workspace=false
2842
- name: Upload coverage report
2943
uses: actions/upload-artifact@v4
3044
if: always()
3145
with:
32-
name: coverage-report-jre21
46+
name: coverage-report-jre21-${{ matrix.os }}-bazel-${{ matrix.bazel }}
3347
path: bazel-out/_coverage/_coverage_report.dat
3448
if-no-files-found: warn
3549
- name: Upload test logs
3650
uses: actions/upload-artifact@v4
3751
if: always()
3852
with:
39-
name: test-logs-jre21
53+
name: test-logs-jre21-${{ matrix.os }}-bazel-${{ matrix.bazel }}
4054
path: bazel-testlogs/
4155
if-no-files-found: warn
4256
test-jre11-run-example:
43-
runs-on: ubuntu-latest
57+
runs-on: ${{ matrix.os }}
4458
strategy:
4559
fail-fast: false
4660
matrix:
4761
include:
48-
- bazel: '7.x'
62+
- os: ubuntu-latest
63+
bazel: '7.x'
4964
disable_workspace: 'false'
5065
extra_flags: ''
51-
- bazel: '7.x'
66+
- os: ubuntu-latest
67+
bazel: '7.x'
5268
disable_workspace: 'false'
5369
extra_flags: '--incompatible_disable_native_repo_rules'
54-
- bazel: '8.x'
70+
- os: ubuntu-latest
71+
bazel: '8.x'
5572
disable_workspace: 'true'
5673
extra_flags: ''
57-
- bazel: '8.6.0rc1'
74+
- os: ubuntu-latest
75+
bazel: '8.6.0rc1'
5876
disable_workspace: 'true'
5977
extra_flags: ''
60-
- bazel: '8.x'
78+
- os: ubuntu-latest
79+
bazel: '8.x'
6180
disable_workspace: 'true'
6281
extra_flags: '--incompatible_disable_native_repo_rules'
63-
- bazel: '9.x'
82+
- os: ubuntu-latest
83+
bazel: '9.x'
6484
disable_workspace: 'true'
6585
extra_flags: ''
66-
- bazel: '9.x'
86+
- os: ubuntu-latest
87+
bazel: '9.x'
6788
disable_workspace: 'true'
6889
extra_flags: '--incompatible_disable_native_repo_rules'
90+
# Skip Windows + Bazel 7.x due to protobuf compilation issues on MSVC
91+
# Windows is tested with Bazel 8.x and 9.x which are more current
92+
- os: windows-latest
93+
bazel: '8.x'
94+
disable_workspace: 'true'
95+
extra_flags: ''
96+
- os: windows-latest
97+
bazel: '9.x'
98+
disable_workspace: 'true'
99+
extra_flags: ''
69100
steps:
70101
- name: Setup Java JDK
71102
uses: actions/setup-java@v4
@@ -78,18 +109,39 @@ jobs:
78109
with:
79110
go-version: ^1.17
80111
id: go
81-
- name: Setup Bazelisk
112+
- name: Setup Bazelisk (Linux/macOS)
113+
if: runner.os != 'Windows'
82114
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
115+
- name: Setup Bazelisk (Windows)
116+
if: runner.os == 'Windows'
117+
shell: pwsh
118+
run: |
119+
go install github.com/bazelbuild/bazelisk@latest
120+
$env:PATH = "$env:PATH;$(go env GOPATH)\bin"
121+
echo "$env:USERPROFILE\go\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
83122
- uses: actions/checkout@v4
84123
with:
85124
fetch-depth: 0
86-
- name: Run bazel-diff example script
125+
- name: Run bazel-diff example script (Linux)
126+
if: runner.os != 'Windows'
87127
env:
88128
USE_BAZEL_VERSION: ${{ matrix.bazel }}
89129
BAZEL_DIFF_DISABLE_WORKSPACE: ${{ matrix.disable_workspace }}
90130
BAZEL_DIFF_FORCE_CHECKOUT: true
91131
BAZEL_EXTRA_COMMAND_OPTIONS: ${{ matrix.extra_flags }}
92132
run: ./bazel-diff-example.sh "$GITHUB_WORKSPACE" ~/go/bin/bazelisk $(git rev-parse HEAD~1) $(git rev-parse HEAD)
133+
- name: Run bazel-diff example script (Windows)
134+
if: runner.os == 'Windows'
135+
env:
136+
USE_BAZEL_VERSION: ${{ matrix.bazel }}
137+
BAZEL_DIFF_DISABLE_WORKSPACE: ${{ matrix.disable_workspace }}
138+
BAZEL_DIFF_FORCE_CHECKOUT: true
139+
BAZEL_EXTRA_COMMAND_OPTIONS: ${{ matrix.extra_flags }}
140+
shell: pwsh
141+
run: |
142+
$prevRev = git rev-parse HEAD~1
143+
$currRev = git rev-parse HEAD
144+
.\bazel-diff-example.ps1 -WorkspacePath "$env:GITHUB_WORKSPACE" -BazelPath "$env:USERPROFILE\go\bin\bazelisk.exe" -PreviousRevision $prevRev -FinalRevision $currRev
93145
deploy:
94146
needs: [test-jre21]
95147
runs-on: ubuntu-latest

MODULE.bazel

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

77
bazel_dep(name = "rules_license", version = "1.0.0", dev_dependency = True)
8-
bazel_dep(name = "aspect_rules_lint", version = "1.0.2", dev_dependency = True)
8+
bazel_dep(name = "aspect_rules_lint", version = "2.1.0", dev_dependency = True)
99
bazel_dep(name = "aspect_bazel_lib", version = "2.22.5", dev_dependency = True)
1010

1111
bazel_dep(name = "bazel_skylib", version = "1.9.0")

0 commit comments

Comments
 (0)