From e98b0540059114655a92117e34e8feaef7028e51 Mon Sep 17 00:00:00 2001 From: Alex Tercete Date: Thu, 9 Jan 2025 15:39:16 +0000 Subject: [PATCH 1/3] ci: use `ruleset` subcomponents to avoid unneeded jobs The `config` and `os` jobs in the `ruleset` components were redundant, as we're already running `local` and `linux` in the `version` jobs. So we've switched to using the subcomponents explicit to allow fine-grained control of the jobs. This has cut down the jobs we run from 8 to 4. --- .gitlab-ci.yml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f70dca77..8d415d81 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,20 +1,28 @@ include: - - component: "${CI_SERVER_HOST}/ci/component/bazelisk/ruleset@v1.1.0" + - component: "${CI_SERVER_HOST}/ci/component/bazelisk/version@v1.2.0" inputs: extends: - .base needs: - - oci - format-check versions: - 7.4.0 - 7.x - configs: - - local - # FIXME: enable remote builds - #- remote - oses: - - linux + # FIXME: enable remote builds + #- component: "${CI_SERVER_HOST}/ci/component/bazelisk/config@v1.2.0" + # inputs: + # extends: + # - .base + # needs: + # - format-check + # config: + # - remote + - component: "${CI_SERVER_HOST}/ci/component/bazelisk/semantic-release@v1.2.0" + inputs: + extends: + - .base + needs: + - version default: tags: -- GitLab From 06f17d6d688dfa95e5c440b34f6d9f98a9e1ddb1 Mon Sep 17 00:00:00 2001 From: Alex Tercete Date: Tue, 14 Jan 2025 14:35:26 +0000 Subject: [PATCH 2/3] ci: remove unneeded dependency --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8d415d81..ba754225 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -76,8 +76,6 @@ format-check: pages: stage: deploy extends: .base - needs: - - oci script: - bazelisk run docs:public artifacts: -- GitLab From ea48abdcf67d90d2d493addcd24e882760a0eff1 Mon Sep 17 00:00:00 2001 From: Alex Tercete Date: Wed, 8 Jan 2025 09:58:20 +0000 Subject: [PATCH 3/3] ci: only use metal runners for QEMU E2E tests We now have a separate job for QEMU tests, which we only run on merge trains and on `main`. As a bonus, the performance of the localhost tests has also improved, as we're not running it in parallel with the QEMU tests. --- .gitlab-ci.yml | 22 ++++++++++++++-------- e2e/BUILD.bazel | 4 ---- e2e/localhost/BUILD.bazel | 4 ---- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ba754225..b2e927f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,19 +32,25 @@ default: .base: extends: .job + variables: + # FIXME: Only exclude `//qemu` when `ROOT` is `e2e` + TARGET: //... -//qemu/... + script: + - cd "${ROOT}"; bazelisk test --config="${CONFIG}" -- ${TARGET} + +qemu: + extends: .base + variables: + ROOT: e2e + CONFIG: local + TARGET: //qemu/... tags: - arm64 - linux - metal - variables: - TARGET: "//..." rules: - - if: $ROOT == "e2e" && $CI_MERGE_REQUEST_IID - variables: - TARGET: "//:ci" - - !reference [.bazelisk, rules] - script: - - cd "${ROOT}"; bazelisk test --config="${CONFIG}" ${TARGET} + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + - if: $CI_MERGE_REQUEST_EVENT_TYPE == "merge_train" oci: stage: .pre diff --git a/e2e/BUILD.bazel b/e2e/BUILD.bazel index d3242e79..e69de29b 100644 --- a/e2e/BUILD.bazel +++ b/e2e/BUILD.bazel @@ -1,4 +0,0 @@ -test_suite( - name = "ci", - tests = ["//localhost"], -) diff --git a/e2e/localhost/BUILD.bazel b/e2e/localhost/BUILD.bazel index 05b48f0a..51fad29e 100644 --- a/e2e/localhost/BUILD.bazel +++ b/e2e/localhost/BUILD.bazel @@ -129,7 +129,3 @@ labgrid_test( src = ":inner", platform = "@rules_labgrid//labgrid/platform:localhost", ) - -test_suite( - name = "localhost", -) -- GitLab