Skip to content

Commit e22a337

Browse files
committed
Add Verify Lockfile Correctness Workflow
1 parent d69fccc commit e22a337

2 files changed

Lines changed: 50 additions & 1 deletion

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
name: Bazel Lockfile Check
14+
on:
15+
pull_request:
16+
paths:
17+
- 'MODULE.bazel'
18+
- 'MODULE.bazel.lock'
19+
- '**/Cargo.toml'
20+
- '**/Cargo.lock'
21+
jobs:
22+
validate-lockfile:
23+
name: Verify Lockfile Correctness
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout Source Code
27+
uses: actions/checkout:v4
28+
- name: Setup Bazel
29+
uses: bazel-contrib/setup-bazel@v0.13.0
30+
with:
31+
bazelisk-version: true
32+
repository-cache: true
33+
- name: Assert Lockfile matches Cargo State
34+
id: run-check
35+
run: bazel mod deps --lockfile_mode=error
36+
- name: Instructions on Failure
37+
if: failure() && steps.run-check.outcome == 'failure'
38+
run: |
39+
echo "::error title=Lockfile Out of Sync::Your MODULE.bazel.lock does not match your Cargo configuration changes!"
40+
echo "=============================================================================="
41+
echo " HOW TO FIX THIS BUILD:"
42+
echo "=============================================================================="
43+
echo " Your recent Cargo dependency changes broke the Bazel lockfile state."
44+
echo " Please run the following command locally in your repository root:"
45+
echo ""
46+
echo " bazel mod deps --lockfile_mode=update"
47+
echo ""
48+
echo " Once completed, commit and push the updated 'MODULE.bazel.lock'."
49+
echo "=============================================================================="

.github/workflows/rust_coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: eclipse-score/cicd-workflows/.github/workflows/rust-coverage.yml@main
2121
with:
2222
bazel-test-targets: "//score/..."
23-
bazel-test-config-flags: "--config=bl-x86_64-linux --config=ferrocene-coverage --lockfile_mode=error --test_lang_filters=rust,-miri"
23+
bazel-test-config-flags: "--config=bl-x86_64-linux --config=ferrocene-coverage --test_lang_filters=rust,-miri"
2424
bazel-test-args: "--test_output=errors --nocache_test_results --build_tag_filters=-miri,-loom --test_tag_filters=-miri,-loom"
2525
coverage-target: "//:rust_coverage"
2626
min-coverage: 0

0 commit comments

Comments
 (0)