-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathconfig.yml
More file actions
153 lines (144 loc) · 3.84 KB
/
config.yml
File metadata and controls
153 lines (144 loc) · 3.84 KB
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
orbs:
win: circleci/windows@1.0.0
codecov: codecov/codecov@1.0.5
version: 2.1
environment: &ENVIRONMENT
EMAIL: 62970560+packer-ci@users.noreply.github.com
GIT_AUTHOR_NAME: packer-ci
GIT_COMMITTER_NAME: packer-ci
executors:
golang:
docker:
- image: docker.mirror.hashicorp.services/circleci/golang:1.16
resource_class: medium+
darwin:
macos:
xcode: "12.0.0"
steps:
setup-gpg: &setup-gpg
run:
name: import base64 GPG key and prime passphrase
command: |
echo -e "${GPG_KEY}" | base64 -di | gpg --import --batch
echo "hello world" > temp.txt
gpg --detach-sig --yes -v --output=/dev/null --pinentry-mode loopback --passphrase "${GPG_PASSPHRASE}" temp.txt
rm temp.txt
commands:
install-go-run-tests-unix:
parameters:
GOOS:
type: string
GOVERSION:
type: string
steps:
- checkout
- run: curl https://dl.google.com/go/go<< parameters.GOVERSION >>.<< parameters.GOOS >>-amd64.tar.gz | tar -C ~/ -xz
- run: GO111MODULE=on ~/go/bin/go test ./... -coverprofile=coverage.txt -covermode=atomic
install-go-run-tests-windows:
parameters:
GOVERSION:
type: string
steps:
- checkout
- run: curl https://dl.google.com/go/go<< parameters.GOVERSION >>.windows-amd64.zip --output ~/go<< parameters.GOVERSION >>.windows-amd64.zip
- run: unzip ~/go<< parameters.GOVERSION >>.windows-amd64.zip -d ~/
- run: GO111MODULE=on ~/go/bin/go test ./... -coverprofile=coverage.txt -covermode=atomic
# Golang CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-go/ for more details
jobs:
test-linux:
executor: golang
resource_class: large
working_directory: /go/src/github.com/hashicorp/packer-plugin-sdk
steps:
- checkout
- run: TESTARGS="-coverprofile=coverage.txt -covermode=atomic" make ci
- codecov/upload:
file: coverage.txt
test-darwin:
executor: darwin
working_directory: ~/go/src/github.com/hashicorp/packer-plugin-sdk
environment:
GO111MODULE: "off"
steps:
- install-go-run-tests-unix:
GOOS: darwin
GOVERSION: "1.15"
- codecov/upload:
file: coverage.txt
test-windows:
executor:
name: win/vs2019
shell: bash.exe
steps:
- install-go-run-tests-windows:
GOVERSION: "1.15"
- codecov/upload:
file: coverage.txt
check-lint:
executor: golang
resource_class: xlarge
steps:
- checkout
- run: git fetch --all
- run:
command: make ci-lint
no_output_timeout: 30m
check-fmt:
executor: golang
steps:
- checkout
- run: make fmt-check
check-generate:
executor: golang
working_directory: /go/src/github.com/hashicorp/packer-plugin-sdk
steps:
- checkout
- run: make generate-check
release-sdk:
executor: golang
environment:
<<: *ENVIRONMENT
steps:
- *setup-gpg
- add_ssh_keys:
fingerprints:
- "52:49:7d:88:9b:81:21:fb:71:86:fd:89:c4:4b:95:df" # circleci-key of packer-ci user in GitHub
- checkout
- run: ./scripts/release/release.sh
workflows:
version: 2
test:
jobs:
- test-linux
- test-darwin
- test-windows
check-code:
jobs:
- check-lint
- check-fmt
- check-generate
release:
jobs:
- check-generate
- check-fmt
- check-lint
- test-linux
- trigger-release:
filters:
branches:
only:
- main
type: approval
- release-sdk:
filters:
branches:
only:
- main
requires:
- trigger-release
- check-generate
- check-fmt
- check-lint
- test-linux