-
Notifications
You must be signed in to change notification settings - Fork 19
/
.cirrus.yml
213 lines (189 loc) · 7.73 KB
/
.cirrus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
use_compute_credits: true
docker_builder:
name: Test (Linux with Docker)
alias: Tests
test_script:
- wget --no-verbose -O - https://go.dev/dl/go1.22.1.linux-amd64.tar.gz | tar -C /usr/local -xz
- export PATH=$PATH:/usr/local/go/bin
- go test ./...
env:
HOME: /root
CIRRUS_INTERNAL_RUN_GITHUB_API_TESTS: true
docker_builder:
name: Test (Linux with Podman)
allow_failures: true
alias: Tests
install_podman_script:
- sudo apt-get -y update
- sudo apt-get -y install podman
configure_podman_script:
- echo 'unqualified-search-registries=["docker.io"]' > /etc/containers/registries.conf.d/docker.conf
work_around_gcloud_credential_helper_script:
- rm /root/.docker/config.json
run_podman_background_script:
- podman system service -t 0 unix:///tmp/podman.sock
test_script:
- wget --no-verbose -O - https://go.dev/dl/go1.22.1.linux-amd64.tar.gz | tar -C /usr/local -xz
- export PATH=$PATH:/usr/local/go/bin
- go test ./...
env:
HOME: /root
CIRRUS_CONTAINER_BACKEND: podman
docker_builder:
allow_failures: true
name: Test (Windows)
alias: Tests
platform: windows
os_version: 2019
test_script:
- choco install -y golang git
- refreshenv
- md C:\Windows\system32\config\systemprofile\AppData\Local\Temp
- go test -v ./...
task:
name: Test (macOS with Tart)
alias: Tests
persistent_worker:
labels:
name: dev-mini
resources:
tart-vms: 1
env:
CIRRUS_INTERNAL_TART_VM: ghcr.io/cirruslabs/macos-sonoma-base:latest
CIRRUS_INTERNAL_TART_SSH_PASSWORD: admin
CIRRUS_INTERNAL_TART_SSH_USER: admin
test_script:
- go test -v -p 1 ./...
task:
name: Test (Linux with Vetu)
alias: Tests
aws_credentials:
role_arn: arn:aws:iam::944424729675:role/VetuIntegrationTests
role_session_name: cirrus
region: us-east-2
ec2_instance:
image: ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-arm64-server-*
architecture: arm64
region: us-east-2
type: a1.metal
block_device_mappings:
- device_name: /dev/sda1
ebs:
volume_size: 100
install_vetu_script:
- sudo apt-get update && sudo apt-get -y install apt-transport-https ca-certificates
- echo "deb [trusted=yes] https://apt.fury.io/cirruslabs/ /" | sudo tee /etc/apt/sources.list.d/cirruslabs.list
- sudo apt-get update && sudo apt-get -y install vetu
pre_pull_vm_script:
- vetu pull $CIRRUS_INTERNAL_VETU_VM
test_script:
- wget --no-verbose -O - https://go.dev/dl/go1.22.2.linux-arm64.tar.gz | tar -C /usr/local -xz
- export PATH=$PATH:/usr/local/go/bin
- go test -v -p 1 ./...
env:
CIRRUS_INTERNAL_VETU_VM: ghcr.io/cirruslabs/ubuntu-runner-arm64:latest
CIRRUS_INTERNAL_VETU_SSH_PASSWORD: admin
CIRRUS_INTERNAL_VETU_SSH_USER: admin
HOME: /root
task:
name: Release (Dry Run)
only_if: $CIRRUS_TAG == ''
macos_instance:
image: ghcr.io/cirruslabs/macos-runner:sonoma
env:
MACOS_SIGN_P12: ENCRYPTED[!183482723ca1a95f9c4439f7a79c9d3b115472bb18c739ed1586e12d3914ccf94ade8169eeda7332fc204f8be9c27d9f!]
MACOS_SIGN_PASSWORD: ENCRYPTED[!417423346c567f12007f42d084bff1cfee30ee14f7e8258550157679a269c70d541c9f19224224ab0293b10f2c6d4c5e!]
MACOS_NOTARY_ISSUER_ID: ENCRYPTED[!74076906e9fa36bca3c1da1637b0759b58bb009eb1a707446896eefad3767e8dba1d0f87e71106b98cde98ac4b037a2a!]
MACOS_NOTARY_KEY_ID: ENCRYPTED[!af9e5da1010a6b04e548ef494acc77a6e0ce176549de98f81c5b5cdd72856de09f77e51cf0849e3c4b7a2d2c22f25ca8!]
MACOS_NOTARY_KEY: ENCRYPTED[!c70c53f3e6c163931c7cdf9d90aff8934ef21d5dd1090158688e00b94e97c68257d9cf4ae1df873e6ae0d949866aee72!]
GORELEASER_KEY: ENCRYPTED[!9b80b6ef684ceaf40edd4c7af93014ee156c8aba7e6e5795f41c482729887b5c31f36b651491d790f1f668670888d9fd!]
install_script:
- brew update && brew install go goreleaser/tap/goreleaser-pro getsentry/tools/sentry-cli
goreleaser_script: goreleaser release --skip=publish --snapshot --clean --verbose
binaries_artifacts:
path: "dist/cirrus_*/cirrus*"
task:
name: Release
only_if: $CIRRUS_TAG != ''
macos_instance:
image: ghcr.io/cirruslabs/macos-runner:sonoma
env:
MACOS_SIGN_P12: ENCRYPTED[!183482723ca1a95f9c4439f7a79c9d3b115472bb18c739ed1586e12d3914ccf94ade8169eeda7332fc204f8be9c27d9f!]
MACOS_SIGN_PASSWORD: ENCRYPTED[!417423346c567f12007f42d084bff1cfee30ee14f7e8258550157679a269c70d541c9f19224224ab0293b10f2c6d4c5e!]
MACOS_NOTARY_ISSUER_ID: ENCRYPTED[!74076906e9fa36bca3c1da1637b0759b58bb009eb1a707446896eefad3767e8dba1d0f87e71106b98cde98ac4b037a2a!]
MACOS_NOTARY_KEY_ID: ENCRYPTED[!af9e5da1010a6b04e548ef494acc77a6e0ce176549de98f81c5b5cdd72856de09f77e51cf0849e3c4b7a2d2c22f25ca8!]
MACOS_NOTARY_KEY: ENCRYPTED[!c70c53f3e6c163931c7cdf9d90aff8934ef21d5dd1090158688e00b94e97c68257d9cf4ae1df873e6ae0d949866aee72!]
GITHUB_TOKEN: ENCRYPTED[!98ace8259c6024da912c14d5a3c5c6aac186890a8d4819fad78f3e0c41a4e0cd3a2537dd6e91493952fb056fa434be7c!]
FURY_TOKEN: ENCRYPTED[!97fe4497d9aca60a3d64904883b81e21f19706c6aedda625c97f62f67ec46b8efa74c55699956158bbf0a23726e7d9f6!]
GORELEASER_KEY: ENCRYPTED[!9b80b6ef684ceaf40edd4c7af93014ee156c8aba7e6e5795f41c482729887b5c31f36b651491d790f1f668670888d9fd!]
SENTRY_ORG: cirrus-labs
SENTRY_PROJECT: persistent-workers
SENTRY_AUTH_TOKEN: ENCRYPTED[!c16a5cf7da5f856b4bc2f21fe8cb7aa2a6c981f851c094ed4d3025fd02ea59a58a86cee8b193a69a1fc20fa217e56ac3!]
install_script:
- brew update && brew install go goreleaser/tap/goreleaser-pro getsentry/tools/sentry-cli
release_script: goreleaser
create_sentry_release_script:
- export SENTRY_RELEASE="cirrus-cli@$CIRRUS_TAG"
- sentry-cli releases new $SENTRY_RELEASE
- sentry-cli releases set-commits $SENTRY_RELEASE --auto
- sentry-cli releases finalize $SENTRY_RELEASE
docker_builder:
name: Release Docker Image (Dry Run)
only_if: $CIRRUS_TAG == ''
depends_on: Tests
setup_script:
- docker buildx create --name multibuilder
- docker buildx use multibuilder
- docker buildx inspect --bootstrap
build_script:
- git tag v0.1.0-SNAPSHOT
- docker buildx build --platform linux/amd64,linux/arm64 .
docker_builder:
name: Release Docker Image
only_if: $CIRRUS_TAG != ''
depends_on: Tests
env:
GITHUB_TOKEN: ENCRYPTED[!82ed873afdf627284305afef4958c85a8f73127b09978a9786ac521559630ea6c9a5ab6e7f8315abf9ead09b6eff6eae!]
login_script:
- echo $GITHUB_TOKEN | docker login ghcr.io -u fkorotkov --password-stdin
setup_script:
- docker buildx create --name multibuilder
- docker buildx use multibuilder
- docker buildx inspect --bootstrap
deploy_script: |
docker buildx build --push --platform linux/amd64,linux/arm64 \
--tag ghcr.io/cirruslabs/cirrus-cli:$CIRRUS_TAG \
--tag ghcr.io/cirruslabs/cirrus-cli:latest \
.
task:
name: Check for lacking "buf generate" invocation
container:
image: bufbuild/buf
generate_script: buf generate
check_script: git diff --exit-code
task:
name: Check for lacking "go generate ./..." invocation
container:
image: golang:latest
generate_script: go generate ./...
check_script: git diff --exit-code
task:
only_if: $CIRRUS_TAG != ''
name: buf push (tagged)
container:
image: bufbuild/buf
login_script: echo $BUF_TOKEN | buf registry login --username $BUF_LOGIN --token-stdin
push_script: buf push --label $CIRRUS_TAG
env:
BUF_LOGIN: fkorotkov
BUF_TOKEN: ENCRYPTED[!8ee7eb2504cc84b08d4a7c0dacbe103640b1feaa26d06f0df010784e872d39e65a0cdea3fc7c09b065a917a77113b96b!]
task:
only_if: $CIRRUS_BRANCH != ''
name: buf push (commit)
container:
image: bufbuild/buf
login_script: echo $BUF_TOKEN | buf registry login --username $BUF_LOGIN --token-stdin
push_script: buf push
env:
BUF_LOGIN: fkorotkov
BUF_TOKEN: ENCRYPTED[!8ee7eb2504cc84b08d4a7c0dacbe103640b1feaa26d06f0df010784e872d39e65a0cdea3fc7c09b065a917a77113b96b!]