From 0fe682fc005c49b7f9774e175f0eaf6f5080fd35 Mon Sep 17 00:00:00 2001 From: Matt Clarkson Date: Tue, 10 Dec 2024 15:16:43 +0000 Subject: [PATCH] fix: support testing on multiple operating systems The `input:oses` can be set to an array of operating systems to test each job on. By default, Linux and Windows are tested. --- .gitlab-ci.yml | 2 ++ .releaserc.yaml | 5 ++++ templates/ruleset/os.yml | 42 ++++++++++++++++++++++++++++++++++ templates/ruleset/template.yml | 13 +++++++++++ 4 files changed, 62 insertions(+) create mode 100644 templates/ruleset/os.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c6ae281..16d9161 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,8 @@ include: - local versions: - 7.0.0 + oses: + - linux default: tags: diff --git a/.releaserc.yaml b/.releaserc.yaml index ab22537..efc2cc6 100644 --- a/.releaserc.yaml +++ b/.releaserc.yaml @@ -24,6 +24,10 @@ plugins: frontMatter: "process" expression: |- .spec.inputs.tag.default = "${nextRelease.version}" + - filepath: "templates/ruleset/os.yml" + frontMatter: "process" + expression: |- + .spec.inputs.tag.default = "${nextRelease.version}" - filepath: "templates/ruleset/version.yml" frontMatter: "process" expression: |- @@ -46,6 +50,7 @@ plugins: - "CHANGELOG.md" - "templates/bazelisk.yml" - "templates/ruleset/.job.yml" + - "templates/ruleset/os.yml" - "templates/ruleset/version.yml" - "templates/ruleset/config.yml" - "templates/ruleset/template.yml" diff --git a/templates/ruleset/os.yml b/templates/ruleset/os.yml new file mode 100644 index 0000000..26fa385 --- /dev/null +++ b/templates/ruleset/os.yml @@ -0,0 +1,42 @@ +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." + needs: + type: array + default: [] + description: "Jobs to run before the `version` job." + roots: + type: array + default: + - . + - e2e + description: "Root directories of Bazel modules to test." + oses: + type: array + default: + - linux + - windows + description: "The operating systems to test on." +--- +include: + - local: "/templates/ruleset/.job.yml" + inputs: + image: "$[[inputs.image]]" + tag: "$[[inputs.tag]]" + +os: + extends: .job + needs: $[[inputs.needs]] + variables: + CI_LOCKFILE_MODE: "off" + tags: + - "${OS}" + parallel: + matrix: + - ROOT: $[[inputs.roots]] + OS: $[[inputs.oses]] diff --git a/templates/ruleset/template.yml b/templates/ruleset/template.yml index c722785..61634d6 100644 --- a/templates/ruleset/template.yml +++ b/templates/ruleset/template.yml @@ -33,6 +33,12 @@ spec: - 7.x - last_rc description: "The Bazel versions tested." + oses: + type: array + default: + - linux + - windows + description: "The operating systems to test on." --- include: - local: "/templates/ruleset/version.yml" @@ -47,8 +53,15 @@ include: image: "$[[inputs.image]]" tag: "$[[inputs.tag]]" needs: $[[inputs.needs]] + roots: $[[inputs.roots]] configs: $[[inputs.configs]] + - local: "/templates/ruleset/os.yml" + inputs: + image: "$[[inputs.image]]" + tag: "$[[inputs.tag]]" + needs: $[[inputs.needs]] roots: $[[inputs.roots]] + oses: $[[inputs.oses]] - local: "/templates/ruleset/semantic-release.yml" inputs: image: "$[[inputs.image]]" -- GitLab