diff --git a/.bazelrc.ci b/.bazelrc.ci index 038267c2b6f431ce7adc99c5a1b95257bcc73671..8f8d31a7c4003a9e4dc710f2ee1ba5a39afe7d4f 100644 --- a/.bazelrc.ci +++ b/.bazelrc.ci @@ -26,7 +26,7 @@ test --test_output=errors test --test_verbose_timeout_warnings # Validate that the lockfile is correct -common --lockfile_mode=error +common --lockfile_mode=${CI_LOCKFILE_MODE} # These locations are cached on the CI build:local --disk_cache=${CI_PROJECT_DIR}/.cache/bazel/disk diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 402c56bb19a89b944dd6177f3fc023c9dfedc66f..b2aa0153d6adda4ce00d1aa758a5c927c17ef67c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,36 +14,57 @@ include: CI_COMMIT_REF_NAME CI_COMMIT_SHA CI_SERVER_HOST + CI_LOCKFILE_MODE default: tags: - arm64 -test: +.test: extends: .bazelisk cache: - !reference [.bazelisk, cache] - key: "bazel-cache-${CI_PROJECT_ID}" paths: - - ".cache/bazel/disk" - - ".cache/bazel/repo" + - ".cache/bazel/disk" + - ".cache/bazel/repo" + variables: + CI_LOCKFILE_MODE: error + CONFIG: local + script: + - (cd "${ROOT}"; bazelisk test --config="${CONFIG}" //...) + +config: + extends: .test parallel: matrix: - ROOT: - - . - - e2e + - . + - e2e CONFIG: - - local - - remote - script: - - (cd "${ROOT}"; bazelisk build --config="${CONFIG}" //...) - - (cd "${ROOT}"; bazelisk test --config="${CONFIG}" //...) + - local + - remote + +version: + extends: .test + variables: + CI_LOCKFILE_MODE: "off" + parallel: + matrix: + - ROOT: + - . + - e2e + USE_BAZEL_VERSION: + - 7.x + - last_rc # TODO: switch this out for `rules_semantic_release` semantic-release: + extends: .test stage: .post needs: - - test + - config + - version image: node:lts cache: key: diff --git a/e2e/.bazelrc.ci b/e2e/.bazelrc.ci index 038267c2b6f431ce7adc99c5a1b95257bcc73671..8f8d31a7c4003a9e4dc710f2ee1ba5a39afe7d4f 100644 --- a/e2e/.bazelrc.ci +++ b/e2e/.bazelrc.ci @@ -26,7 +26,7 @@ test --test_output=errors test --test_verbose_timeout_warnings # Validate that the lockfile is correct -common --lockfile_mode=error +common --lockfile_mode=${CI_LOCKFILE_MODE} # These locations are cached on the CI build:local --disk_cache=${CI_PROJECT_DIR}/.cache/bazel/disk diff --git a/toolchain/export/symlink/repository.bzl b/toolchain/export/symlink/repository.bzl index 3f5f6690f64764e6ca4b86bad5a81c66549fdc5e..672e4eab092dd38d4115a6321b25a3227f81aaf6 100644 --- a/toolchain/export/symlink/repository.bzl +++ b/toolchain/export/symlink/repository.bzl @@ -11,7 +11,7 @@ ATTRS = { def implementation(rctx): label = rctx.attr.target - workspace = label.relative(":WORKSPACE") + workspace = label.relative(":REPO.bazel") path = rctx.path(workspace) if not path.exists: fail("Failed to find `{}`, can only symlink repository labels.".format(path, label)) diff --git a/toolchain/local/select/repository.bzl b/toolchain/local/select/repository.bzl index fc6ef2580761ef086a543713c5eb43bc0461ed77..4597e5c6aaa573d3ae0fcccae71a4b8f1e9227d5 100644 --- a/toolchain/local/select/repository.bzl +++ b/toolchain/local/select/repository.bzl @@ -39,11 +39,11 @@ def canonical(rctx, label): def implementation(rctx): label = resolve(rctx.attr.map, no_match_error = rctx.attr.no_match_error) canon = canonical(rctx, label) - workspace = Label("{}//:WORKSPACE".format(canon)) + workspace = Label("{}//:REPO.bazel".format(canon)) path = rctx.path(workspace) if not path.exists: - fail("Missing `{}` for `{}`: {}".format(label, select, path)) + fail("Missing `{}` for `{}`: {}".format(canon, rctx.name, path)) rctx.delete(".") rctx.symlink(path.dirname, ".")