Update CircleCI to use Makefile and cache Go dependencies

This commit is contained in:
Alec Sears
2019-10-10 15:13:20 -05:00
parent 233a6b1cf4
commit a50c9a3e77
4 changed files with 1545 additions and 1744 deletions

View File

@@ -26,40 +26,52 @@ jobs:
build:
working_directory: ~/alexanderzobnin/grafana-zabbix
docker:
- image: circleci/node:8
- image: circleci/golang:1.13-node
environment:
YARN_NO_PROGRESS: "true"
steps:
- checkout
- restore_cache:
keys:
- dependency-cache-{{ checksum "yarn.lock" }}
- dependency-cache-npm-{{ checksum "yarn.lock" }}
- dependency-cache-go-{{ checksum "go.sum" }}
- run:
name: yarn install
command: 'yarn install --pure-lockfile --no-progress'
name: Install Dependencies
command: 'make install'
no_output_timeout: 15m
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
key: dependency-cache-npm-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- run: npm run build
- save_cache:
key: dependency-cache-go-{{ checksum "go.sum" }}
paths:
- ./vendor
- run: make build
lint:
working_directory: ~/alexanderzobnin/grafana-zabbix
docker:
- image: circleci/node:8
- image: circleci/golang:1.13-node
steps:
- checkout
- restore_cache:
keys:
- dependency-cache-{{ checksum "yarn.lock" }}
- dependency-cache-npm-{{ checksum "yarn.lock" }}
- dependency-cache-go-{{ checksum "go.sum" }}
- run:
name: yarn install
command: 'yarn install --pure-lockfile --no-progress'
name: Install Dependencies
command: 'make install'
no_output_timeout: 15m
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
key: dependency-cache-npm-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- run: npm run lint
- save_cache:
key: dependency-cache-go-{{ checksum "go.sum" }}
paths:
- ./vendor
- run: make lint
test:
working_directory: ~/alexanderzobnin/grafana-zabbix
@@ -67,7 +79,7 @@ jobs:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
docker:
- image: circleci/node:8
- image: circleci/golang:1.13-node
steps:
- checkout
# Prepare for artifact and test results collection equivalent to how it was done on 1.0.
@@ -76,16 +88,21 @@ jobs:
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
- restore_cache:
keys:
- dependency-cache-{{ checksum "yarn.lock" }}
- dependency-cache-npm-{{ checksum "yarn.lock" }}
- dependency-cache-go-{{ checksum "go.sum" }}
- run:
name: yarn install
command: 'yarn install --pure-lockfile --no-progress'
name: Install Dependencies
command: 'make install'
no_output_timeout: 15m
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
key: dependency-cache-npm-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- run: npm run ci-test
- save_cache:
key: dependency-cache-go-{{ checksum "go.sum" }}
paths:
- ./vendor
- run: make test-ci
- store_test_results:
path: /tmp/circleci-test-results
- store_artifacts:
@@ -96,7 +113,7 @@ jobs:
make-release:
working_directory: ~/alexanderzobnin/grafana-zabbix
docker:
- image: circleci/node:8
- image: circleci/golang:1.13-node
environment:
CI_GIT_USER: CircleCI
CI_GIT_EMAIL: ci@grafana.com
@@ -107,15 +124,20 @@ jobs:
- checkout
- restore_cache:
keys:
- dependency-cache-{{ checksum "yarn.lock" }}
- dependency-cache-npm-{{ checksum "yarn.lock" }}
- dependency-cache-go-{{ checksum "go.sum" }}
- run:
name: yarn install
command: 'yarn install --pure-lockfile --no-progress'
name: Install Dependencies
command: 'make install'
no_output_timeout: 15m
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
key: dependency-cache-npm-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- save_cache:
key: dependency-cache-go-{{ checksum "go.sum" }}
paths:
- ./vendor
- run: ./.circleci/make-release.sh
build-docs:
@@ -141,7 +163,7 @@ jobs:
deploy-docs:
working_directory: ~/grafana-zabbix
docker:
- image: circleci/node:8
- image: circleci/golang:1.13-node
environment:
GH_PAGES_BRANCH: gh-pages
CI_GIT_USER: CircleCI

View File

@@ -29,7 +29,7 @@ RELEASE_BRANCH=release-$RELEASE_VER
# Build plugin
git checkout -b $RELEASE_BRANCH
yarn install --pure-lockfile && yarn build
make clean install dist
# Commit release
git add --force dist/