-
Notifications
You must be signed in to change notification settings - Fork 0
/
.build.yml
76 lines (58 loc) · 2.21 KB
/
.build.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
# SPDX-FileCopyrightText: 2024 Dominik Wombacher <[email protected]>
# SPDX-FileCopyrightText: 2019 The SourceHut API Contributors
#
# SPDX-License-Identifier: BSD-2-Clause
image: debian/stable
sources:
- https://git.sr.ht/~wombelix/terraform-provider-sourcehut/
- https://git.sr.ht/~wombelix/build-helper-scripts
secrets:
- 5b076ab5-1361-4d71-905b-4ff8c836c62c
environment:
GIT_MIRROR_SSH_KEY: ~/.ssh/5b076ab5-1361-4d71-905b-4ff8c836c62c
GIT_MIRROR_GITHUB: [email protected]:wombelix/terraform-provider-sourcehut.git
GIT_MIRROR_GITLAB: [email protected]:wombelix/terraform-provider-sourcehut.git
GIT_MIRROR_CODEBERG: [email protected]:wombelix/terraform-provider-sourcehut.git
GO111MODULE: 'on'
tasks:
- mirror: |
cd build-helper-scripts
source git-mirror.sh
cd ..
cd terraform-provider-sourcehut
git_mirror "$GIT_MIRROR_SSH_KEY" "$GIT_MIRROR_GITHUB"
git_mirror "$GIT_MIRROR_SSH_KEY" "$GIT_MIRROR_GITLAB"
git_mirror "$GIT_MIRROR_SSH_KEY" "$GIT_MIRROR_CODEBERG"
- setup: |
curl -sSfLO https://go.dev/dl/go1.23.4.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local/ -xzf go1.23.4.linux-amd64.tar.gz
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
sudo ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt
go version
go env
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.62.2
curl -sSfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.21.4
- test: |
cd terraform-provider-sourcehut/
go test -v ./...
- lint: |
cd terraform-provider-sourcehut/
`go env GOPATH`/bin/golangci-lint run ./...
- vet: |
cd terraform-provider-sourcehut/
go vet ./...
- fmt: |
cd terraform-provider-sourcehut/
gofmt -s -l . && [ -z "$(gofmt -s -l .)" ]
- gosec: |
cd terraform-provider-sourcehut/
`go env GOPATH`/bin/gosec ./...
- build: |
cd terraform-provider-sourcehut/
make
artifacts:
- terraform-provider-sourcehut/terraform-provider-sourcehut
triggers:
- action: email
condition: failure