telegraf/.circleci/config.yml

261 lines
5.9 KiB
YAML
Raw Normal View History

version: 2.1
orbs:
win: circleci/windows@2.4.0
executors:
go-1_14:
working_directory: '/go/src/github.com/influxdata/telegraf'
docker:
2020-10-08 02:51:49 +08:00
- image: 'quay.io/influxdb/telegraf-ci:1.14.9'
environment:
GOFLAGS: -p=8
go-1_15:
working_directory: '/go/src/github.com/influxdata/telegraf'
2020-10-08 02:51:49 +08:00
docker:
2020-11-21 06:53:44 +08:00
- image: 'quay.io/influxdb/telegraf-ci:1.15.5'
environment:
GOFLAGS: -p=8
mac:
2020-02-21 06:23:13 +08:00
macos:
xcode: 12.1.0
2020-02-21 06:23:13 +08:00
working_directory: '~/go/src/github.com/influxdata/telegraf'
environment:
HOMEBREW_NO_AUTO_UPDATE: 1
GOFLAGS: -p=8
commands:
test-go:
parameters:
goarch:
type: string
default: "amd64"
steps:
- checkout
- attach_workspace:
at: '/go'
- run: 'GOARCH=<< parameters.goarch >> make'
- run: 'GOARCH=<< parameters.goarch >> make check'
- run: 'GOARCH=<< parameters.goarch >> make check-deps'
- run: 'GOARCH=<< parameters.goarch >> make test'
test-go-mac:
steps:
- checkout
- attach_workspace:
at: '/'
- run: 'make'
- run: 'make check'
- run: 'make test'
package:
parameters:
nightly:
type: boolean
default: false
steps:
- checkout
- attach_workspace:
at: '/go'
- when:
condition: << parameters.nightly >>
steps:
- run: 'NIGHTLY=1 make package'
- run: 'make upload-nightly'
- unless:
condition: << parameters.nightly >>
steps:
- run: 'make package'
- store_artifacts:
path: './build/dist'
destination: 'build/dist'
2018-02-02 07:05:39 +08:00
jobs:
deps:
executor: go-1_15
2018-02-02 07:05:39 +08:00
steps:
- checkout
- restore_cache:
key: go-mod-v1-{{ checksum "go.sum" }}
2018-04-03 05:13:15 +08:00
- run: 'make deps'
- run: 'make tidy'
- save_cache:
name: 'go module cache'
key: go-mod-v1-{{ checksum "go.sum" }}
paths:
- '/go/pkg/mod'
- persist_to_workspace:
root: '/go'
paths:
- '*'
2020-02-21 06:23:13 +08:00
macdeps:
executor: mac
2020-02-21 06:23:13 +08:00
steps:
- checkout
- restore_cache:
key: mac-go-mod-v2-{{ checksum "go.sum" }}
2020-07-04 03:06:26 +08:00
- run: 'brew install go' # latest
2020-02-21 06:23:13 +08:00
- run: 'make deps'
- run: 'make tidy'
- save_cache:
name: 'go module cache'
key: mac-go-mod-v2-{{ checksum "go.sum" }}
2020-02-21 06:23:13 +08:00
paths:
- '~/go/pkg/mod'
- '/usr/local/Cellar/go'
- '/usr/local/bin/go'
- '/usr/local/bin/gofmt'
- persist_to_workspace:
root: '/'
paths:
- 'usr/local/bin/go'
- 'usr/local/Cellar/go'
- 'usr/local/bin/gofmt'
- 'Users/distiller/go'
test-go-1_14:
executor: go-1_14
steps:
- test-go
test-go-1_14-386:
executor: go-1_14
steps:
- test-go:
goarch: "386"
test-go-1_15:
executor: go-1_15
steps:
- test-go
test-go-1_15-386:
executor: go-1_15
2018-10-20 02:01:31 +08:00
steps:
- test-go:
goarch: "386"
2020-07-04 03:06:26 +08:00
test-go-darwin:
executor: mac
2020-02-21 06:23:13 +08:00
steps:
- test-go-mac
test-go-windows:
executor:
name: win/default
shell: powershell.exe
steps:
- checkout
- run: choco upgrade golang --version=1.15.5
- run: choco install make
- run: git config --system core.longpaths true
- run: make test-windows
package:
executor: go-1_15
steps:
- package
2018-02-02 07:05:39 +08:00
release:
executor: go-1_15
2018-02-02 07:05:39 +08:00
steps:
- package
2018-02-02 07:05:39 +08:00
nightly:
executor: go-1_15
2018-02-02 07:05:39 +08:00
steps:
- package:
nightly: true
2018-02-02 07:05:39 +08:00
workflows:
version: 2
check:
2018-02-02 07:05:39 +08:00
jobs:
2020-02-21 06:23:13 +08:00
- 'macdeps':
filters:
tags:
only: /.*/
- 'deps':
filters:
tags:
only: /.*/
- 'test-go-1_14':
requires:
- 'deps'
filters:
tags:
only: /.*/
- 'test-go-1_14-386':
2018-10-20 02:01:31 +08:00
requires:
- 'deps'
filters:
tags:
only: /.*/
- 'test-go-1_15':
requires:
- 'deps'
filters:
tags:
only: /.*/
- 'test-go-1_15-386':
requires:
- 'deps'
filters:
tags:
only: /.*/
2020-07-04 03:06:26 +08:00
- 'test-go-darwin':
2020-02-21 06:23:13 +08:00
requires:
- 'macdeps'
filters:
tags: # only runs on tags if you specify this filter
only: /.*/
- 'test-go-windows':
filters:
tags:
only: /.*/
- 'package':
requires:
- 'test-go-windows'
- 'test-go-darwin'
- 'test-go-1_14'
- 'test-go-1_14-386'
- 'test-go-1_15'
- 'test-go-1_15-386'
2018-02-02 07:05:39 +08:00
- 'release':
requires:
- 'test-go-windows'
- 'test-go-darwin'
- 'test-go-1_14'
- 'test-go-1_14-386'
- 'test-go-1_15'
- 'test-go-1_15-386'
filters:
tags:
only: /.*/
branches:
ignore: /.*/
2018-02-02 07:05:39 +08:00
nightly:
jobs:
- 'deps'
- 'macdeps'
- 'test-go-1_14':
requires:
- 'deps'
- 'test-go-1_14-386':
2018-10-20 02:01:31 +08:00
requires:
- 'deps'
- 'test-go-1_15':
requires:
- 'deps'
- 'test-go-1_15-386':
requires:
- 'deps'
- 'test-go-darwin':
requires:
- 'macdeps'
- 'test-go-windows'
2018-02-03 04:29:54 +08:00
- 'nightly':
requires:
- 'test-go-windows'
- 'test-go-darwin'
- 'test-go-1_14'
- 'test-go-1_14-386'
- 'test-go-1_15'
- 'test-go-1_15-386'
2018-02-02 07:05:39 +08:00
triggers:
- schedule:
2018-04-25 04:42:42 +08:00
cron: "0 7 * * *"
2018-02-02 07:05:39 +08:00
filters:
branches:
only:
- master