2020-04-02 21:31:19 +08:00
|
|
|
test_task:
|
2020-04-04 06:23:06 +08:00
|
|
|
env:
|
|
|
|
ELVISH_TEST_TIME_SCALE: 10
|
2020-04-05 21:48:40 +08:00
|
|
|
CODECOV_TOKEN: e10d2e99-591b-4d2a-a8cf-8ca3e8d6df61
|
2020-07-11 00:29:48 +08:00
|
|
|
TEST_FLAG: -race
|
2020-04-04 04:07:32 +08:00
|
|
|
go_modules_cache:
|
2020-04-03 02:31:03 +08:00
|
|
|
fingerprint_script: cat go.sum
|
2020-04-03 11:36:13 +08:00
|
|
|
folder: $GOPATH/pkg/mod
|
2020-04-03 00:27:31 +08:00
|
|
|
matrix:
|
2020-04-03 09:30:00 +08:00
|
|
|
- name: Test on Linux
|
|
|
|
container:
|
2020-04-03 00:27:31 +08:00
|
|
|
image: golang:latest
|
2020-04-04 04:07:32 +08:00
|
|
|
- name: Test on Linux (Old Supported Go Version)
|
|
|
|
container:
|
|
|
|
image: golang:1.13
|
2020-04-15 06:27:34 +08:00
|
|
|
env:
|
|
|
|
# This should have the same coverage as the previous task, so skip it.
|
|
|
|
SKIP_UPLOAD_COVERAGE: 1
|
2020-07-11 00:29:48 +08:00
|
|
|
- name: Test on Linux (Gccgo)
|
|
|
|
container:
|
|
|
|
image: debian:unstable-slim
|
|
|
|
setup_script:
|
|
|
|
- apt-get -y update
|
|
|
|
- apt-get -y install ca-certificates gccgo-go
|
|
|
|
env:
|
|
|
|
# This should have the same coverage as the previous task, so skip it.
|
|
|
|
SKIP_UPLOAD_COVERAGE: 1
|
|
|
|
# Gccgo doesn't support race test
|
|
|
|
TEST_FLAG: ""
|
2020-04-03 09:30:00 +08:00
|
|
|
- name: Test on macOS
|
|
|
|
osx_instance:
|
2020-04-03 00:27:31 +08:00
|
|
|
image: catalina-base
|
2020-04-03 02:31:03 +08:00
|
|
|
setup_script: brew install go
|
2020-04-03 11:36:13 +08:00
|
|
|
env:
|
|
|
|
GOPATH: $HOME/go
|
2020-04-03 09:30:00 +08:00
|
|
|
- name: Test on FreeBSD
|
|
|
|
freebsd_instance:
|
2020-04-03 00:27:31 +08:00
|
|
|
image_family: freebsd-12-1
|
2020-04-04 04:47:34 +08:00
|
|
|
setup_script: pkg install -y go bash
|
2020-04-03 11:36:13 +08:00
|
|
|
env:
|
|
|
|
GOPATH: $HOME/go
|
2020-04-15 06:27:34 +08:00
|
|
|
# For some reason the FreeBSD runner often has problem reaching codecov.
|
|
|
|
# Skip it to prevent the coverage from fluctuating, and make the FreeBSD
|
|
|
|
# task faster. There are very few files that are built on FreeBSD but not
|
|
|
|
# Linux, so losing this part of the data makes very little difference.
|
|
|
|
SKIP_UPLOAD_COVERAGE: 1
|
2020-04-03 09:59:32 +08:00
|
|
|
go_version_script: go version
|
2020-07-11 00:29:48 +08:00
|
|
|
test_script: go test $TEST_FLAG ./...
|
2020-04-04 04:07:32 +08:00
|
|
|
upload_coverage_script:
|
2020-04-15 06:31:02 +08:00
|
|
|
- test -z $SKIP_UPLOAD_COVERAGE || exit 0
|
2020-04-04 04:07:32 +08:00
|
|
|
- go test -coverprofile=coverage -covermode=set ./...
|
2020-07-06 02:18:57 +08:00
|
|
|
- curl -s https://codecov.io/bash -o codecov && bash codecov -f coverage -t $CODECOV_TOKEN || true
|
2020-04-04 06:23:06 +08:00
|
|
|
|
2020-06-25 06:21:59 +08:00
|
|
|
checkstyle_go_task:
|
|
|
|
name: Check the style of .go files
|
|
|
|
container:
|
|
|
|
image: golang:latest
|
|
|
|
env:
|
|
|
|
PATH: $HOME/go/bin:$PATH
|
|
|
|
setup_script: go get golang.org/x/tools/cmd/goimports
|
|
|
|
check_script: make checkstyle-go
|
|
|
|
|
|
|
|
checkstyle_md_task:
|
|
|
|
name: Check the style of .md files
|
|
|
|
container:
|
|
|
|
image: node:latest
|
|
|
|
env:
|
|
|
|
PATH: $HOME/.npm-packages/bin:$PATH
|
|
|
|
setup_script: npm install --global prettier
|
|
|
|
check_script: make checkstyle-md
|
|
|
|
|
2020-04-04 06:23:06 +08:00
|
|
|
deploy_task:
|
|
|
|
name: Build binaries and deploy to bintray
|
2020-04-05 20:16:08 +08:00
|
|
|
only_if: $CIRRUS_PR == ""
|
2020-04-04 06:23:06 +08:00
|
|
|
env:
|
2020-04-04 07:25:40 +08:00
|
|
|
BINTRAY_TOKEN: ENCRYPTED[1a1820d17a2014de6b1798d379f86aa24bbd8acd5149656a98bfdf33746c78c85fefc8e6e522fedacdf8c4bf92bb25a0]
|
2020-04-04 06:23:06 +08:00
|
|
|
go_modules_cache:
|
|
|
|
fingerprint_script: cat go.sum
|
|
|
|
folder: $GOPATH/pkg/mod
|
|
|
|
container:
|
2020-04-04 07:11:27 +08:00
|
|
|
image: theelves/cirrus-builder
|
2020-04-04 06:23:06 +08:00
|
|
|
go_version_script: go version
|
|
|
|
deploy_script: ./tools/cirrus-deploy.sh
|