Skip to content

Commit 3fc05ea

Browse files
locking: enforce Bzlmod lockfile consistency (#169)
* locking: enforce Bzlmod lockfile consistency - add reusable lockfile check workflow - track MODULE.bazel.lock (remove from .gitignore) - enforce --lockfile_mode=error in CI and scripts Addresses eclipse-score/score#2628 * lock: update lockfile updated lockfile Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> * fix: formatting fix Fixed formatting Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> * revert: don't use the lockfile_mode in scripts Ensure the decoupling from CI and local builds this way Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> --------- Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com>
1 parent a51fd5c commit 3fc05ea

9 files changed

Lines changed: 8504 additions & 9 deletions

.github/workflows/build_and_test_autosd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
sudo apt-get install -y podman curl qemu-system createrepo-c
4848
- name: Build Showcases
4949
run: |
50-
bazel build --config autosd-x86_64 //images/autosd_x86_64:score-showcases
50+
bazel build --lockfile_mode=error --config autosd-x86_64 //images/autosd_x86_64:score-showcases
5151
- name: Copy showcases folder
5252
run: |
5353
set -e

.github/workflows/build_and_test_ebclfsa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
cache-save: ${{ github.event_name == 'push' }}
4444
- name: Build for EB corbos Linux for Safety Applications and run tests
4545
run: |
46-
bazel build --config=eb-aarch64 //images/ebclfsa_aarch64/scrample_integration:run
46+
bazel build --lockfile_mode=error --config=eb-aarch64 //images/ebclfsa_aarch64/scrample_integration:run
4747
- name: Upload test logs
4848
uses: actions/upload-artifact@v5
4949
with:

.github/workflows/build_and_test_linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
cache-save: ${{ github.event_name == 'push' }}
4545
- name: Build image
4646
run: |
47-
bazel build --config=linux-x86_64 //images/linux_x86_64:image
47+
bazel build --lockfile_mode=error --config=linux-x86_64 //images/linux_x86_64:image
4848
- name: Integration tests
4949
run: |
50-
bazel test --config=linux-x86_64 //feature_integration_tests/itf:linux_x86_64
50+
bazel test --lockfile_mode=error --config=linux-x86_64 //feature_integration_tests/itf:linux_x86_64

.github/workflows/build_and_test_qnx.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ jobs:
7070
SCORE_QNX_USER: ${{ secrets.SCORE_QNX_USER }}
7171
SCORE_QNX_PASSWORD: ${{ secrets.SCORE_QNX_PASSWORD }}
7272
run: |
73-
bazel build --config qnx-x86_64 //images/qnx_x86_64:image
73+
bazel build --lockfile_mode=error --config qnx-x86_64 //images/qnx_x86_64:image
7474
- name: Run integration tests
7575
run: |
76-
bazel test --config=itf-qnx-x86_64 //feature_integration_tests/itf:qnx_x86_64
76+
bazel test --lockfile_mode=error --config=itf-qnx-x86_64 //feature_integration_tests/itf:qnx_x86_64
7777
- name: Cleanup QNX license
7878
if: always()
7979
run: sudo rm -rf /opt/score_qnx

.github/workflows/bzlmod-lock.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 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: Bzlmod Lockfile Check
14+
on:
15+
pull_request:
16+
types: [opened, reopened, synchronize]
17+
merge_group:
18+
types: [checks_requested]
19+
push:
20+
branches:
21+
- main
22+
jobs:
23+
bzlmod-lock:
24+
uses: eclipse-score/cicd-workflows/.github/workflows/bzlmod-lock-check.yml@main
25+
with:
26+
working-directory: .

.github/workflows/test_and_docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
run: |
8686
mkdir -p artifacts
8787
find bazel-testlogs/external -name 'test.xml' -print0 | xargs -0 -I{} cp --parents {} artifacts/
88-
cp -r "$(bazel info bazel-bin)/coverage/rust-tests" artifacts/rust
88+
cp -r "$(bazel info --lockfile_mode=error bazel-bin)/coverage/rust-tests" artifacts/rust
8989
zip -r ${{ github.event.repository.name }}_test_reports.zip artifacts/
9090
shell: bash
9191
- name: Upload release asset (attach ZIP to GitHub Release)
@@ -103,6 +103,7 @@ jobs:
103103
- name: Build documentation
104104
run: |
105105
bazel --output_base="/home/runner/.cache/bazel/output_base" run \
106+
--lockfile_mode=error \
106107
--repo_contents_cache="/home/runner/.cache/bazel/repo_contents" \
107108
--repository_cache="/home/runner/.cache/bazel/repo" \
108109
--disk_cache="/home/runner/.cache/bazel/disk" \

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Bazel
22
bazel-*
3-
MODULE.bazel.lock
43
user.bazelrc
54

65
_logs

MODULE.bazel.lock

Lines changed: 8470 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel_common/score_python.MODULE.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ python.toolchain(
2020
is_default = True,
2121
python_version = PYTHON_VERSION,
2222
)
23-
use_repo(python)
2423

2524
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True)
2625
pip.parse(

0 commit comments

Comments
 (0)