Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ci/component/bazelisk
1 result
Show changes
Commits on Source (8)
Showing
with 5693 additions and 4647 deletions
e2e
# `bzlmod` pre-release registries
common --registry https://bcr.bazel.build
common --registry=https://gitlab.arm.com/bazel/pre-commit/-/releases/v1.0.4/downloads
common --registry=https://gitlab.arm.com/bazel/pre-commit-hooks/-/releases/v1.1.0/downloads
# Build cache
build --experimental_guard_against_concurrent_changes
......@@ -16,5 +21,9 @@ common --attempt_to_print_relative_paths
# Enable hermetic `rules_python`
common --@rules_python//python/config_settings:bootstrap_impl=script
# Disable Bazel output for `pre-commit` hooks
common:pre-commit --ui_event_filters=-info,-stdout,-stderr
common:pre-commit --noshow_progress
# User-specific .bazelrc
try-import %workspace%/.bazelrc.user
......@@ -10,7 +10,7 @@ include:
configs:
- local
versions:
- 7.0.0
- 7.4.0
oses:
- linux
......
# [1.4.0](https://git.gitlab.arm.com/ci/component/bazelisk/compare/v1.3.0...v1.4.0) (2025-03-17)
### Features
- create `hooks` component ([69265c6](https://git.gitlab.arm.com/ci/component/bazelisk/commit/69265c6c80e5918b6c6a6ac03f35eeb770ce6813))
- use `[@pre-commit](https://git.gitlab.arm.com/pre-commit)` ([94c43a5](https://git.gitlab.arm.com/ci/component/bazelisk/commit/94c43a56acf4bfa332e72c7f5387e935220a6594))
# [1.3.0](https://git.gitlab.arm.com/ci/component/bazelisk/compare/v1.2.1...v1.3.0) (2025-03-05)
### Bug Fixes
......
......@@ -2,6 +2,15 @@
## Getting Started
- [Install](https://github.com/bazelbuild/bazelisk#installation) `bazelisk`
- Run `bazelisk test //...`
- Run `bazelisk test $(bazelisk query "attr(tags, '\bmanual\b', //...)")`
[Install](https://github.com/bazelbuild/bazelisk#installation) `bazelisk` and run the tests:
```sh
$ bazelisk test //...
$ bazelisk test $(bazelisk query "attr(tags, '\bmanual\b', //...)")
```
Set up Git hooks:
```sh
$ bazelisk run //hooks:install
```
module(
name = "bazelisk",
version = "1.3.0",
version = "1.4.0",
bazel_compatibility = [
">=7.0.0",
">=7.4.0",
],
)
......@@ -13,8 +13,11 @@ bazel_dep(name = "rules_distroless", version = "0.3.8")
bazel_dep(name = "rules_oci", version = "2.0.1")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "container_structure_test", version = "1.19.1")
bazel_dep(name = "download_utils", version = "1.0.0-beta.2")
bazel_dep(name = "rules_python", version = "0.34.0", dev_dependency=True)
bazel_dep(name = "download_utils", version = "1.0.1")
bazel_dep(name = "pre-commit", version = "1.0.4", dev_dependency = True)
bazel_dep(name = "pre-commit-hooks", version = "1.1.0", dev_dependency = True)
bazel_dep(name = "rules_python", version = "1.2.0", dev_dependency = True)
# We have to avoid the `chmod`/`chown`/`id` unhermetic-ness
# TODO: remove this when `ignore_root_user_error` is hermetic
......@@ -47,6 +50,7 @@ use_repo(oci, "distroless", "distroless_linux_386", "distroless_linux_amd64", "d
# Bazelisk
download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "download_file")
[
download_file(
name = "{}-{}".format(cpu, os),
......@@ -66,7 +70,6 @@ download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "downlo
# Debian packages
apt = use_extension("@rules_distroless//apt:extensions.bzl", "apt")
apt.install(
name = "bazelisk-package",
lock = "//bazelisk:packages.lock.json",
......@@ -76,6 +79,7 @@ use_repo(apt, "bazelisk-package")
# FIXME: remove these in favour of `bazelisk-package`
download_deb = use_repo_rule("@download_utils//download/deb:defs.bzl", "download_deb")
[
download_deb(
name = "{}-{}".format(
......
This diff is collapsed.
load("@bazel_skylib//lib:selects.bzl", "selects")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_pkg//pkg:mappings.bzl", "pkg_mklink")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
selects.config_setting_group(
name = "arm64-linux",
......
......@@ -71,7 +71,7 @@ TOOLS = (
# `rules_python`
# TODO: use `rctx.os.arch` in `rules_python`
"uname",
# TODO: replace tools below used in '@rules_python//python/config_settings:venvs_use_declare_symlink'
# TODO: replace tools below used in '@rules_python//python/config_settings:venvs_use_declare_symlink'
"basename",
"ln",
......
load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_image_index", "oci_push")
load("@rules_oci//oci:defs.bzl", "oci_image_index", "oci_push")
oci_image_index(
name = "image",
......
......@@ -2,7 +2,8 @@ module(
name = "e2e",
)
bazel_dep(name = "rules_python", version = "0.34.0", dev_dependency=True)
bazel_dep(name = "rules_python", version = "1.2.0", dev_dependency = True)
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "bazelisk")
local_path_override(
......@@ -20,4 +21,3 @@ dev.toolchain(
ignore_root_user_error = True,
python_version = "3.11",
)
This diff is collapsed.
# Regenerate with `bazel run -- //hooks:config`. Do not edit
minimum_pre_commit_version: 2.18.0
default_install_hook_types:
- pre-commit
repos:
- repo: local
hooks:
- id: '@pre-commit-hooks//buildifier:format'
name: Format Bazel files
description: Will load a `.buildifier.json` at the root of the workspace for extra
configuration.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- @pre-commit-hooks//buildifier:format
types_or:
- bazel
- id: '@pre-commit-hooks//buildifier:lint'
name: Lint Bazel files
description: Will load a `.buildifier.json` at the root of the workspace for extra
configuration.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- @pre-commit-hooks//buildifier:lint
types_or:
- bazel
- id: '@pre-commit-hooks//ruff:check'
name: Check Python files with `ruff`
description: Performs checks with `ruff` against Python files. Will read a `ruff.toml`
for configuration.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- @pre-commit-hooks//ruff:check
types:
- python
- id: '@pre-commit-hooks//ruff:format'
name: Format Python files with `ruff`
description: Performs formatting with `ruff` against Python files. Will read a
`ruff.toml` for configuration.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- @pre-commit-hooks//ruff:format
types:
- python
- id: '@pre-commit-hooks//shellcheck'
name: Lint Shell files with `shellcheck`
description: Performs linting with `shellcheck` against Shell files.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- @pre-commit-hooks//shellcheck
types:
- shell
- id: '@pre-commit-hooks//shfmt'
name: Format Shell files with `shfmt`
description: Performs formatting with `shfmt` against Shell files.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- @pre-commit-hooks//shfmt
types:
- shell
- id: //hooks:config
name: Update `pre-commit` config
description: Keeps the `.pre-commit-config.yaml` in sync with any changes to the
`pre_commit_config` rule.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- //hooks:config
pass_filenames: false
files: ^(MODULE.bazel.lock|hooks/BUILD.bazel)$
load("@pre-commit//pre-commit:defs.bzl", "pre_commit")
pre_commit(
name = "hooks",
srcs = ["@pre-commit-hooks"],
)
......@@ -4,7 +4,7 @@ spec:
default: registry.gitlab.arm.com/ci/component/bazelisk
description: "Open container image (OCI) to use."
tag:
default: 1.3.0
default: 1.4.0
description: "Open container image (OCI) tag for the image."
stage:
default: test
......
......@@ -4,7 +4,7 @@ spec:
default: registry.gitlab.arm.com/ci/component/bazelisk
description: "Open container image (OCI) to use."
tag:
default: 1.3.0
default: 1.4.0
description: "Open container image (OCI) tag for the image."
extends:
type: array
......
# `hooks`
> A job for running [`pre-commit`] hooks
## Getting Started
```yaml
include:
- component: "${CI_SERVER_HOST}/ci/component/bazelisk/hooks@<version>"
```
Select a `<version>` according to [CI component versions].
[`pre-commit`]: https://gitlab.arm.com/bazel/pre-commit
[CI component versions]: https://docs.gitlab.com/ee/ci/components/#component-versions
spec:
inputs:
image:
default: registry.gitlab.arm.com/ci/component/bazelisk
description: "Open container image (OCI) to use."
tag:
default: latest
description: "Open container image (OCI) tag for the image."
extends:
type: array
default:
- .job
description: "Jobs for the testing jobs to extend."
needs:
type: array
default: []
description: "Jobs to run before the `version` job."
roots:
type: array
default:
- .
description: "Root directories of Bazel modules to test."
location:
type: string
default: hooks
description: "Path to the folder containing the hooks"
---
include:
- local: "/templates/ruleset/.job.yml"
inputs:
image: "$[[inputs.image]]"
tag: "$[[inputs.tag]]"
hooks:
stage: .pre
extends: $[[inputs.extends]]
needs: $[[inputs.needs]]
variables:
TARGET: "//$[[inputs.location]]"
script:
- bazelisk run -- ${TARGET}
......@@ -4,7 +4,7 @@ spec:
default: registry.gitlab.arm.com/ci/component/bazelisk
description: "Open container image (OCI) to use."
tag:
default: 1.3.0
default: 1.4.0
description: "Open container image (OCI) tag for the image."
extends:
type: array
......
......@@ -4,7 +4,7 @@ spec:
default: registry.gitlab.arm.com/ci/component/bazelisk
description: "Open container image (OCI) to use."
tag:
default: 1.3.0
default: 1.4.0
description: "Open container image (OCI) tag for the image."
config:
default: local
......