Files
cloudpods/.circleci/config.yml
Jian Qiu 84cdeff92b fix: update vendor for clickhouse v2 (#14520)
* fix: update vendor for clickhouse v2

* fix: fix go vet

* fix: unreachable codes

* fix: composite literal uses unkeyed fields

* fix: ignore bad syntax for struct tag value

* fix: use make test to do test ci job

* fix: specify circleci resource_class

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2022-06-25 15:52:15 +08:00

88 lines
2.3 KiB
YAML

# Golang CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-go/ for more details
version: 2
jobs:
check:
docker:
- image: yunion/centos-build:1.1-6
environment:
ONECLOUD_CI_BUILD: "1"
working_directory: /root/go/src/yunion.io/x/onecloud
steps:
- checkout
- run:
command: |
make -j3 check
build:
requires:
- check
docker:
- image: yunion/centos-build:1.1-6
environment:
ONECLOUD_CI_BUILD: "1"
#### TEMPLATE_NOTE: go expects specific checkout path representing url
#### expecting it in the form of
#### /go/src/github.com/circleci/go-tool
#### /go/src/bitbucket.org/circleci/go-tool
working_directory: /root/go/src/yunion.io/x/onecloud
resource_class: large
parallelism: 1
steps:
- checkout
- restore_cache:
key: onecloud-build-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
paths:
- /root/.cache/go-build
- run:
command: |
targets="$(circleci tests glob "cmd/*" | grep -v cmd/host-image | circleci tests split)"
echo $targets | tr ' ' '\n'
make $targets
ls -lh _output/bin/
- save_cache:
key: onecloud-build-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
paths:
- /root/.cache/go-build
- store_artifacts:
path: _output/
test:
requires:
- check
docker:
- image: yunion/centos-build:1.1-6
environment:
ONECLOUD_CI_BUILD: "1"
working_directory: /root/go/src/yunion.io/x/onecloud
resource_class: large
parallelism: 1
steps:
- checkout
- restore_cache:
key: onecloud-test-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
paths:
- /root/.cache/go-build
- run:
name: unit_test
command: |
make test
- save_cache:
key: onecloud-test-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
paths:
- /root/.cache/go-build
workflows:
version: 2
build_and_test:
jobs:
- check
- build:
requires:
- check
- test
- test:
requires:
- check