Skip to content

Commit 2833f5d

Browse files
locking: enforce Bzlmod lockfile consistency (eclipse-score#72)
* 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 * updated lock file * fix: mixed params Mixed params for reusable workflow cpp-coverage Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> * fix: add permission add detail permission to shut copilot up Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> * fix: review Added lockfile for qnx builds 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 38e8762 commit 2833f5d

11 files changed

Lines changed: 7740 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ jobs:
6262
6363
- name: Build with Bazel
6464
run: |
65-
bazel build --config x86_64-linux //...
65+
bazel build --lockfile_mode=error --config x86_64-linux //...

.github/workflows/build_qnx8.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
with:
3030
bazel-target: '//score/... //tests/...'
3131
bazel-config: ${{ matrix.config }}
32+
extra-bazel-flags: '--lockfile_mode=error'
3233
credential-helper: 'scripts/internal/qnx_creds.py'
3334
environment-name: 'workflow-approval'
3435
secrets:

.github/workflows/bzlmod-lock.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
permissions:
15+
contents: read
16+
on:
17+
pull_request:
18+
types: [opened, reopened, synchronize]
19+
merge_group:
20+
types: [checks_requested]
21+
push:
22+
branches:
23+
- main
24+
jobs:
25+
bzlmod-lock:
26+
uses: eclipse-score/cicd-workflows/.github/workflows/bzlmod-lock-check.yml@main
27+
with:
28+
working-directory: .

.github/workflows/copyright.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
copyright-check:
2525
uses: eclipse-score/cicd-workflows/.github/workflows/copyright.yml@main
2626
with:
27-
bazel-target: "run //:copyright.check"
27+
bazel-target: "run --lockfile_mode=error //:copyright.check"

.github/workflows/coverage_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ jobs:
2727
uses: eclipse-score/cicd-workflows/.github/workflows/cpp-coverage.yml@main
2828
with:
2929
bazel-target: "//..."
30+
extra-bazel-flags: "--lockfile_mode=error"

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ jobs:
3939

4040
with:
4141
# the bazel-target depends on your repo specific docs_targets configuration (e.g. "suffix")
42-
bazel-target: "//:docs -- --github_user=${{ github.repository_owner }} --github_repo=${{ github.event.repository.name }}"
42+
bazel-target: "--lockfile_mode=error //:docs -- --github_user=${{ github.repository_owner }} --github_repo=${{ github.event.repository.name }}"
4343
retention-days: 3

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
formatting-check:
2525
uses: eclipse-score/cicd-workflows/.github/workflows/format.yml@main
2626
with:
27-
bazel-target: "test //:format.check" # optional, this is the default
27+
bazel-target: "test --lockfile_mode=error //:format.check" # optional, this is the default

.github/workflows/license_check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ jobs:
2929
uses: eclipse-score/cicd-workflows/.github/workflows/license-check.yml@main
3030
with:
3131
repo-url: "${{ github.server_url }}/${{ github.repository }}"
32+
bazel-target: "run --lockfile_mode=error //:license-check"
3233
secrets:
3334
dash-api-token: ${{ secrets.ECLIPSE_GITLAB_API_TOKEN }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
# Bazel
3636
bazel-*
37-
MODULE.bazel.lock
3837
user.bazelrc
3938

4039
# Compilation databases for code completion in IDEs

MODULE.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ python.toolchain(
8787
is_default = True,
8888
python_version = PYTHON_VERSION,
8989
)
90-
use_repo(python)
9190

9291
# C++ dependencies
9392

0 commit comments

Comments
 (0)