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 (9)
......@@ -16,7 +16,7 @@ plugins:
- "@semantic-release/bzlmod"
- path: "@semantic-release/yq"
assets:
- filepath: "templates/bazelisk.yml"
- filepath: "templates/bazelisk/template.yml"
frontMatter: "process"
expression: |-
.spec.inputs.tag.default = "${nextRelease.version}"
......@@ -24,15 +24,15 @@ plugins:
frontMatter: "process"
expression: |-
.spec.inputs.tag.default = "${nextRelease.version}"
- filepath: "templates/ruleset/os.yml"
- filepath: "templates/os/template.yml"
frontMatter: "process"
expression: |-
.spec.inputs.tag.default = "${nextRelease.version}"
- filepath: "templates/ruleset/version.yml"
- filepath: "templates/version/template.yml"
frontMatter: "process"
expression: |-
.spec.inputs.tag.default = "${nextRelease.version}"
- filepath: "templates/ruleset/config.yml"
- filepath: "templates/config/template.yml"
frontMatter: "process"
expression: |-
.spec.inputs.tag.default = "${nextRelease.version}"
......@@ -40,7 +40,7 @@ plugins:
frontMatter: "process"
expression: |-
.spec.inputs.tag.default = "${nextRelease.version}"
- filepath: "templates/ruleset/semantic-release.yml"
- filepath: "templates/semantic-release/template.yml"
frontMatter: "process"
expression: |-
.spec.inputs.tag.default = "${nextRelease.version}"
......@@ -48,13 +48,13 @@ plugins:
assets:
- "MODULE.bazel"
- "CHANGELOG.md"
- "templates/bazelisk.yml"
- "templates/bazelisk/template.yml"
- "templates/ruleset/.job.yml"
- "templates/ruleset/os.yml"
- "templates/ruleset/version.yml"
- "templates/ruleset/config.yml"
- "templates/os/template.yml"
- "templates/version/template.yml"
- "templates/config/template.yml"
- "templates/ruleset/template.yml"
- "templates/ruleset/semantic-release.yml"
- "templates/semantic-release/template.yml"
- path: "@semantic-release/bzlmod"
source:
prefix: "${CI_PROJECT_NAME}-v${version}"
......
......@@ -9,7 +9,7 @@ Files:
*/test/*.yaml
*.bzl
*.sh
templates/bazelisk.yml
templates/*.yml
Copyright: 2024 Arm Ltd.
License: MIT
......
# [1.2.0](https://git.gitlab.arm.com/ci/component/bazelisk/compare/v1.1.0...v1.2.0) (2025-01-14)
### Bug Fixes
- **semantic-release:** inline default for `needs` ([1cb2f8c](https://git.gitlab.arm.com/ci/component/bazelisk/commit/1cb2f8cdfcc0adf63da00ae06c5fb56d11fc0f59))
### Features
- **ruleset:** add `8.x` to the version tests ([d813836](https://git.gitlab.arm.com/ci/component/bazelisk/commit/d81383642a74198d88afafbcbf53ded5ce4ef4df))
- **ruleset:** add `macos` to default list of operating systems ([8dc7cc0](https://git.gitlab.arm.com/ci/component/bazelisk/commit/8dc7cc096b6806112a884a8761e8b04d79a2cd03))
- **ruleset:** expose subcomponents ([27a08ce](https://git.gitlab.arm.com/ci/component/bazelisk/commit/27a08ce9ebcca1d4a94a2a72c59abd1d35da343e))
- **semantic-release:** support `extends` ([2d44a95](https://git.gitlab.arm.com/ci/component/bazelisk/commit/2d44a956022deea04714d6638bcf7c7e79d3a965))
# [1.1.0](https://git.gitlab.arm.com/ci/component/bazelisk/compare/v1.0.1...v1.1.0) (2024-12-19)
### Bug Fixes
......
module(
name = "bazelisk",
version = "1.1.0",
version = "1.2.0",
bazel_compatibility = [
">=7.0.0",
],
......
# `ci/component/bazelisk`
> A GitLab CI component for running Bazel builds
> A set of GitLab CI components for running Bazel builds
## Getting Started
Add the CI component to the `.gitlab-ci.yml`:
Most users should choose between the [`ruleset`] (opinionated) and the [`bazelisk`] (fully-customizable) components.
```yaml
include:
- component: "${CI_SERVER_HOST}/ci/component/bazelisk/bazelisk@<version>"
```
The [`config`], [`version`], [`os`] and [`semantic-release`] are subcomponents of [`ruleset`], and are exposed for users wanting to opt-out of any of the default jobs.
Add a job that extends the `.bazelisk` template to recursively test the project:
```yaml
test:
extends: .bazelisk
```
## Variables
The template has some environment variables that can customise the job behaviour.
### `ROOT`
To run `bazelisk` in multiple root directories:
```yaml
test:
extends: .bazelisk
parallel:
matrix:
- ROOT:
- .
- e2e
```
### `USE_BAZEL_VERSION`
`bazelisk` will download a version of Bazel as described in the [documentation][bazelisk-download].
To run against multiple versions of Bazel:
```yaml
test:
extends: .bazelisk
parallel:
matrix:
- USE_BAZEL_VERSION:
- 6.3.1
- 7.0.0
```
## Open Container Image (OCI)
The default image has `bazelisk` available on `PATH` and a minimal set of core utilities to satisfy GitLab CI job bring-up and built-in Bazel scripts.
The intention is that this image helps prove the hermeticity of a Bazel build as all tools will need to be resolved hermetically.
To use a different base image, override the image input for the component:
```yaml
include:
- component: gitlab.arm.com/ci/component/bazelisk@<version>
inputs:
image: host.com/some/registry/bazelisk
tag: latest
```
### OCI Local Usage
Assuming the current working directory is the root of the project to test, run the following:
```shell
$ podman run \
-v $PWD:/mnt/src \
-w /mnt/src \
--rm \
-it registry.gitlab.arm.com/ci/component/bazelisk:1.0.0-beta.2 \
/bin/sh
sh-5.2$ bazelisk test //...
```
## YAML References
The `.bazelisk` template provides a simple way to invoke `bazelisk` in a job.
GitLab CI has a [`!reference`][gitlab-ci-reference] feature that allows parts of a template to be re-used in a fine grained way.
It is recommended to use this feature to build up a custom `bazelisk` job by using `!reference` to select parts of the `.bazelisk` image that are relevant.
Commonly, this is used to customise the `script` section of a job but still re-using parts of the `.bazelisk` template script:
```yaml
custom:
extends:
- .bazelisk
- .credentials
before_script:
- !reference [.bazelisk, before_script]
- !reference [.credentials, before_script]
script:
- bazelisk build //...
- bazelisk run //...
```
[package-registry]: https://gitlab.arm.com/ci/component/bazelisk/-/packages
[gitlab-ci-reference]: https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html#reference-tags
[bazelisk-download]: https://github.com/bazelbuild/bazelisk#how-does-bazelisk-know-which-bazel-version-to-run
[`ruleset`]: templates/ruleset/
[`bazelisk`]: templates/bazelisk/
[`config`]: templates/config/
[`version`]: templates/version/
[`os`]: templates/os/
[`semantic-release`]: templates/semantic-release/
# `bazelisk`
> A component for running Bazel builds
## Getting Started
Add the CI component to the `.gitlab-ci.yml`:
```yaml
include:
- component: "${CI_SERVER_HOST}/ci/component/bazelisk/bazelisk@<version>"
```
Add a job that extends the `.bazelisk` template to recursively test the project:
```yaml
test:
extends: .bazelisk
```
## Variables
The template has some environment variables that can customise the job behaviour.
### `ROOT`
To run `bazelisk` in multiple root directories:
```yaml
test:
extends: .bazelisk
parallel:
matrix:
- ROOT:
- .
- e2e
```
### `USE_BAZEL_VERSION`
`bazelisk` will download a version of Bazel as described in the [documentation][bazelisk-download].
To run against multiple versions of Bazel:
```yaml
test:
extends: .bazelisk
parallel:
matrix:
- USE_BAZEL_VERSION:
- 6.3.1
- 7.0.0
```
## Open Container Image (OCI)
The default image has `bazelisk` available on `PATH` and a minimal set of core utilities to satisfy GitLab CI job bring-up and built-in Bazel scripts.
The intention is that this image helps prove the hermeticity of a Bazel build as all tools will need to be resolved hermetically.
To use a different base image, override the image input for the component:
```yaml
include:
- component: gitlab.arm.com/ci/component/bazelisk@<version>
inputs:
image: host.com/some/registry/bazelisk
tag: latest
```
### OCI Local Usage
Assuming the current working directory is the root of the project to test, run the following:
```shell
$ podman run \
-v $PWD:/mnt/src \
-w /mnt/src \
--rm \
-it registry.gitlab.arm.com/ci/component/bazelisk:1.0.0-beta.2 \
/bin/sh
sh-5.2$ bazelisk test //...
```
## YAML References
The `.bazelisk` template provides a simple way to invoke `bazelisk` in a job.
GitLab CI has a [`!reference`][gitlab-ci-reference] feature that allows parts of a template to be re-used in a fine grained way.
It is recommended to use this feature to build up a custom `bazelisk` job by using `!reference` to select parts of the `.bazelisk` image that are relevant.
Commonly, this is used to customise the `script` section of a job but still re-using parts of the `.bazelisk` template script:
```yaml
custom:
extends:
- .bazelisk
- .credentials
before_script:
- !reference [.bazelisk, before_script]
- !reference [.credentials, before_script]
script:
- bazelisk build //...
- bazelisk run //...
```
[package-registry]: https://gitlab.arm.com/ci/component/bazelisk/-/packages
[gitlab-ci-reference]: https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html#reference-tags
[bazelisk-download]: https://github.com/bazelbuild/bazelisk#how-does-bazelisk-know-which-bazel-version-to-run
......@@ -4,7 +4,7 @@ spec:
default: registry.gitlab.arm.com/ci/component/bazelisk
description: "Open container image (OCI) to use."
tag:
default: 1.1.0
default: 1.2.0
description: "Open container image (OCI) tag for the image."
stage:
default: test
......
# `config`
> A set of jobs for testing different [Bazel configurations]
## Getting Started
```yaml
include:
- component: "${CI_SERVER_HOST}/ci/component/bazelisk/config@<version>"
```
Select a `<version>` according to [CI component versions].
## Requirements
- There are `local`/`remote` configurations in `.bazelrc.ci`
- The `e2e` directory exists for end-to-end testing of the ruleset
[Bazel configurations]: https://bazel.build/extending/config
[CI component versions]: https://docs.gitlab.com/ee/ci/components/#component-versions
......@@ -4,7 +4,7 @@ spec:
default: registry.gitlab.arm.com/ci/component/bazelisk
description: "Open container image (OCI) to use."
tag:
default: 1.1.0
default: 1.2.0
description: "Open container image (OCI) tag for the image."
extends:
type: array
......
# `os`
> A set of jobs for testing different operating systems
## Getting Started
```yaml
include:
- component: "${CI_SERVER_HOST}/ci/component/bazelisk/os@<version>"
```
Select a `<version>` according to [CI component versions].
## Requirements
- The `e2e` directory exists for end-to-end testing of the ruleset
- The runner tags `linux`, `windows` and `macos` exist
[CI component versions]: https://docs.gitlab.com/ee/ci/components/#component-versions
......@@ -4,7 +4,7 @@ spec:
default: registry.gitlab.arm.com/ci/component/bazelisk
description: "Open container image (OCI) to use."
tag:
default: 1.1.0
default: 1.2.0
description: "Open container image (OCI) tag for the image."
extends:
type: array
......@@ -26,6 +26,7 @@ spec:
default:
- linux
- windows
- macos
description: "The operating systems to test on."
---
include:
......
......@@ -4,7 +4,7 @@ spec:
default: registry.gitlab.arm.com/ci/component/bazelisk
description: "Open container image (OCI) to use."
tag:
default: 1.1.0
default: 1.2.0
description: "Open container image (OCI) tag for the image."
config:
default: local
......@@ -20,7 +20,7 @@ spec:
- error
---
include:
- local: "/templates/bazelisk.yml"
- local: "/templates/bazelisk/template.yml"
inputs:
image: "$[[inputs.image]]"
tag: "$[[inputs.tag]]"
......
......@@ -4,7 +4,7 @@ spec:
default: registry.gitlab.arm.com/ci/component/bazelisk
description: "Open container image (OCI) to use."
tag:
default: 1.1.0
default: 1.2.0
description: "Open container image (OCI) tag for the image."
minimum:
default: 7.4.0
......@@ -46,7 +46,7 @@ spec:
description: "The operating systems to test on."
---
include:
- local: "/templates/ruleset/version.yml"
- local: "/templates/version/template.yml"
inputs:
image: "$[[inputs.image]]"
tag: "$[[inputs.tag]]"
......@@ -54,7 +54,7 @@ include:
needs: $[[inputs.needs]]
roots: $[[inputs.roots]]
versions: $[[inputs.versions]]
- local: "/templates/ruleset/config.yml"
- local: "/templates/config/template.yml"
inputs:
image: "$[[inputs.image]]"
tag: "$[[inputs.tag]]"
......@@ -62,7 +62,7 @@ include:
needs: $[[inputs.needs]]
roots: $[[inputs.roots]]
configs: $[[inputs.configs]]
- local: "/templates/ruleset/os.yml"
- local: "/templates/os/template.yml"
inputs:
image: "$[[inputs.image]]"
tag: "$[[inputs.tag]]"
......@@ -70,7 +70,11 @@ include:
needs: $[[inputs.needs]]
roots: $[[inputs.roots]]
oses: $[[inputs.oses]]
- local: "/templates/ruleset/semantic-release.yml"
- local: "/templates/semantic-release/template.yml"
inputs:
image: "$[[inputs.image]]"
tag: "$[[inputs.tag]]"
needs:
- config
- version
- os
# `semantic-release`
> A set of jobs for releasing a Bazel ruleset
## Getting Started
```yaml
include:
- component: "${CI_SERVER_HOST}/ci/component/bazelisk/semantic-release@<version>"
```
Select a `<version>` according to [CI component versions].
## Requirements
- `semantic-release` is configured for the project
[CI component versions]: https://docs.gitlab.com/ee/ci/components/#component-versions
......@@ -4,13 +4,16 @@ spec:
default: registry.gitlab.arm.com/ci/component/bazelisk
description: "Open container image (OCI) to use."
tag:
default: 1.1.0
default: 1.2.0
description: "Open container image (OCI) tag for the image."
needs:
extends:
type: array
default:
- config
- version
- .job
description: "Jobs to extend."
needs:
type: array
default: []
description: "Jobs to run before the `semantic-release` job."
---
include:
......@@ -21,7 +24,7 @@ include:
# TODO: switch this out for `rules_semantic_release`
semantic-release:
extends: .job
extends: $[[inputs.extends]]
stage: .post
image: node:lts
needs: $[[inputs.needs]]
......
# `version`
> A set of jobs for testing different Bazel versions
## Getting Started
```yaml
include:
- component: "${CI_SERVER_HOST}/ci/component/bazelisk/version@<version>"
```
Select a `<version>` according to [CI component versions].
## Requirements
- The `e2e` directory exists for end-to-end testing of the ruleset
[CI component versions]: https://docs.gitlab.com/ee/ci/components/#component-versions
......@@ -4,7 +4,7 @@ spec:
default: registry.gitlab.arm.com/ci/component/bazelisk
description: "Open container image (OCI) to use."
tag:
default: 1.1.0
default: 1.2.0
description: "Open container image (OCI) tag for the image."
extends:
type: array
......@@ -26,6 +26,7 @@ spec:
default:
- 7.4.0
- 7.x
- 8.x
- last_rc
description: "The Bazel versions tested."
---
......