blob: b63fcf2e781ad4c518f86fb81117c9355c521df3 [file] [log] [blame]
Paul Jolly5b3d5512021-02-01 14:33:07 +00001// Copyright 2021 The CUE Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Paul Jolly236a5652022-06-29 11:29:47 +010015// package github declares the workflows for this project.
Paul Jolly2795dcc2022-05-29 05:54:34 +010016package github
Paul Jolly65163a02020-05-16 07:48:35 +010017
18import (
Paul Jolly236a5652022-06-29 11:29:47 +010019 "cuelang.org/go/internal/ci/base"
20 "cuelang.org/go/internal/ci/gerrithub"
21
Paul Jolly78cc7852020-05-28 05:12:18 +010022 "github.com/SchemaStore/schemastore/src/schemas/json"
Paul Jolly65163a02020-05-16 07:48:35 +010023)
24
Paul Jollyc3f30d82020-08-19 11:41:46 +010025workflows: [...{file: string, schema: (json.#Workflow & {})}]
Paul Jolly65163a02020-05-16 07:48:35 +010026workflows: [
27 {
Paul Jollyf28ad412022-07-06 17:31:37 +010028 // Note: the name of the file corresponds to the environment variable
29 // names for gerritstatusupdater. Therefore, this filename must only be
30 // change in combination with also updating the environment in which
31 // gerritstatusupdater is running for this repository.
Paul Jollyd4526fe2022-07-11 11:07:21 +010032 file: "trybot.yml"
33 schema: trybot
Paul Jolly65163a02020-05-16 07:48:35 +010034 },
35 {
Paul Jollyd4526fe2022-07-11 11:07:21 +010036 file: "trybot_dispatch.yml"
37 schema: trybot_dispatch
Paul Jolly65163a02020-05-16 07:48:35 +010038 },
39 {
40 file: "release.yml"
41 schema: release
42 },
43 {
Paul Jolly6c6b4e72021-04-29 16:12:04 +010044 file: "tip_triggers.yml"
45 schema: tip_triggers
46 },
Paul Jolly65163a02020-05-16 07:48:35 +010047]
48
Paul Jolly236a5652022-06-29 11:29:47 +010049// TODO: _#repositoryURL and _#unityURL should be extracted from codereview.cfg
50_#repositoryURL: "https://github.com/cue-lang/cue"
51_#unityURL: "https://github.com/cue-unity/unity"
Paul Jollyccbfbd22021-01-14 17:50:29 +000052
Paul Jolly236a5652022-06-29 11:29:47 +010053_#defaultBranch: "master"
54_#releaseTagPattern: "v*"
Paul Jollyccbfbd22021-01-14 17:50:29 +000055
Daniel Martídc2c9e02022-04-09 17:03:59 +090056// Use the latest Go version for extra checks,
57// such as running tests with the data race detector.
58_#latestStableGo: "1.18.x"
59
60// Use a specific latest version for release builds.
61// Note that we don't want ".x" for the sake of reproducibility,
62// so we instead pin a specific Go release.
63_#pinnedReleaseGo: "1.18.1"
Paul Jollyccbfbd22021-01-14 17:50:29 +000064
Daniel Martídb3e6ac2022-04-26 11:37:35 +010065_#linuxMachine: "ubuntu-20.04"
66_#macosMachine: "macos-11"
67_#windowsMachine: "windows-2022"
Paul Jollyccbfbd22021-01-14 17:50:29 +000068
Daniel Martí395df202022-08-01 10:01:20 +010069// #_isLatestLinux evaluates to true if the job is running on Linux with the
70// latest version of Go. This expression is often used to run certain steps
71// just once per CI workflow, to avoid duplicated work.
72#_isLatestLinux: "matrix.go-version == '\(_#latestStableGo)' && matrix.os == '\(_#linuxMachine)'"
73
Paul Jolly236a5652022-06-29 11:29:47 +010074_#goreleaserVersion: "v1.8.2"
75
Paul Jollyccbfbd22021-01-14 17:50:29 +000076_#testStrategy: {
77 "fail-fast": false
78 matrix: {
Daniel Martíbd9ae532022-05-05 13:44:26 +010079 "go-version": ["1.17.x", _#latestStableGo]
Paul Jolly7d25ee22021-07-15 17:49:42 +010080 os: [_#linuxMachine, _#macosMachine, _#windowsMachine]
Paul Jollyccbfbd22021-01-14 17:50:29 +000081 }
82}
83
Paul Jolly236a5652022-06-29 11:29:47 +010084// _gerrithub is an instance of ./gerrithub, parameterised by the properties of
85// this project
86_gerrithub: gerrithub & {
87 #repositoryURL: _#repositoryURL
88 #botGitHubUser: "cueckoo"
89 #botGitHubUserTokenSecretsKey: "CUECKOO_GITHUB_PAT"
90 #botGitHubUserEmail: "cueckoo@gmail.com"
91 #botGerritHubUser: #botGitHubUser
92 #botGerritHubUserPasswordSecretsKey: "CUECKOO_GERRITHUB_PASSWORD"
93 #botGerritHubUserEmail: #botGitHubUserEmail
Paul Jollyccbfbd22021-01-14 17:50:29 +000094}
95
Paul Jolly236a5652022-06-29 11:29:47 +010096// _base is an instance of ./base, parameterised by the properties of this
97// project
98//
99// TODO: revisit the naming strategy here. _base and base are very similar.
100// Perhaps rename the import to something more obviously not intended to be
101// used, and then rename the field base?
102_base: base & {
103 #repositoryURL: "https://github.com/cue-lang/cue"
104 #defaultBranch: _#defaultBranch
105 #botGitHubUser: "cueckoo"
106 #botGitHubUserTokenSecretsKey: "CUECKOO_GITHUB_PAT"
Paul Jollyccbfbd22021-01-14 17:50:29 +0000107}