Update CircleCI to use Makefile and cache Go dependencies
This commit is contained in:
@@ -26,40 +26,52 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
working_directory: ~/alexanderzobnin/grafana-zabbix
|
working_directory: ~/alexanderzobnin/grafana-zabbix
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8
|
- image: circleci/golang:1.13-node
|
||||||
|
environment:
|
||||||
|
YARN_NO_PROGRESS: "true"
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- dependency-cache-{{ checksum "yarn.lock" }}
|
- dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||||
|
- dependency-cache-go-{{ checksum "go.sum" }}
|
||||||
- run:
|
- run:
|
||||||
name: yarn install
|
name: Install Dependencies
|
||||||
command: 'yarn install --pure-lockfile --no-progress'
|
command: 'make install'
|
||||||
no_output_timeout: 15m
|
no_output_timeout: 15m
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: dependency-cache-{{ checksum "yarn.lock" }}
|
key: dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||||
paths:
|
paths:
|
||||||
- ./node_modules
|
- ./node_modules
|
||||||
- run: npm run build
|
- save_cache:
|
||||||
|
key: dependency-cache-go-{{ checksum "go.sum" }}
|
||||||
|
paths:
|
||||||
|
- ./vendor
|
||||||
|
- run: make build
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
working_directory: ~/alexanderzobnin/grafana-zabbix
|
working_directory: ~/alexanderzobnin/grafana-zabbix
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8
|
- image: circleci/golang:1.13-node
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- dependency-cache-{{ checksum "yarn.lock" }}
|
- dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||||
|
- dependency-cache-go-{{ checksum "go.sum" }}
|
||||||
- run:
|
- run:
|
||||||
name: yarn install
|
name: Install Dependencies
|
||||||
command: 'yarn install --pure-lockfile --no-progress'
|
command: 'make install'
|
||||||
no_output_timeout: 15m
|
no_output_timeout: 15m
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: dependency-cache-{{ checksum "yarn.lock" }}
|
key: dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||||
paths:
|
paths:
|
||||||
- ./node_modules
|
- ./node_modules
|
||||||
- run: npm run lint
|
- save_cache:
|
||||||
|
key: dependency-cache-go-{{ checksum "go.sum" }}
|
||||||
|
paths:
|
||||||
|
- ./vendor
|
||||||
|
- run: make lint
|
||||||
|
|
||||||
test:
|
test:
|
||||||
working_directory: ~/alexanderzobnin/grafana-zabbix
|
working_directory: ~/alexanderzobnin/grafana-zabbix
|
||||||
@@ -67,7 +79,7 @@ jobs:
|
|||||||
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
|
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
|
||||||
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
|
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8
|
- image: circleci/golang:1.13-node
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
# Prepare for artifact and test results collection equivalent to how it was done on 1.0.
|
# 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
|
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- dependency-cache-{{ checksum "yarn.lock" }}
|
- dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||||
|
- dependency-cache-go-{{ checksum "go.sum" }}
|
||||||
- run:
|
- run:
|
||||||
name: yarn install
|
name: Install Dependencies
|
||||||
command: 'yarn install --pure-lockfile --no-progress'
|
command: 'make install'
|
||||||
no_output_timeout: 15m
|
no_output_timeout: 15m
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: dependency-cache-{{ checksum "yarn.lock" }}
|
key: dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||||
paths:
|
paths:
|
||||||
- ./node_modules
|
- ./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:
|
- store_test_results:
|
||||||
path: /tmp/circleci-test-results
|
path: /tmp/circleci-test-results
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
@@ -96,7 +113,7 @@ jobs:
|
|||||||
make-release:
|
make-release:
|
||||||
working_directory: ~/alexanderzobnin/grafana-zabbix
|
working_directory: ~/alexanderzobnin/grafana-zabbix
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8
|
- image: circleci/golang:1.13-node
|
||||||
environment:
|
environment:
|
||||||
CI_GIT_USER: CircleCI
|
CI_GIT_USER: CircleCI
|
||||||
CI_GIT_EMAIL: ci@grafana.com
|
CI_GIT_EMAIL: ci@grafana.com
|
||||||
@@ -107,15 +124,20 @@ jobs:
|
|||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- dependency-cache-{{ checksum "yarn.lock" }}
|
- dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||||
|
- dependency-cache-go-{{ checksum "go.sum" }}
|
||||||
- run:
|
- run:
|
||||||
name: yarn install
|
name: Install Dependencies
|
||||||
command: 'yarn install --pure-lockfile --no-progress'
|
command: 'make install'
|
||||||
no_output_timeout: 15m
|
no_output_timeout: 15m
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: dependency-cache-{{ checksum "yarn.lock" }}
|
key: dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||||
paths:
|
paths:
|
||||||
- ./node_modules
|
- ./node_modules
|
||||||
|
- save_cache:
|
||||||
|
key: dependency-cache-go-{{ checksum "go.sum" }}
|
||||||
|
paths:
|
||||||
|
- ./vendor
|
||||||
- run: ./.circleci/make-release.sh
|
- run: ./.circleci/make-release.sh
|
||||||
|
|
||||||
build-docs:
|
build-docs:
|
||||||
@@ -141,7 +163,7 @@ jobs:
|
|||||||
deploy-docs:
|
deploy-docs:
|
||||||
working_directory: ~/grafana-zabbix
|
working_directory: ~/grafana-zabbix
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8
|
- image: circleci/golang:1.13-node
|
||||||
environment:
|
environment:
|
||||||
GH_PAGES_BRANCH: gh-pages
|
GH_PAGES_BRANCH: gh-pages
|
||||||
CI_GIT_USER: CircleCI
|
CI_GIT_USER: CircleCI
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ RELEASE_BRANCH=release-$RELEASE_VER
|
|||||||
|
|
||||||
# Build plugin
|
# Build plugin
|
||||||
git checkout -b $RELEASE_BRANCH
|
git checkout -b $RELEASE_BRANCH
|
||||||
yarn install --pure-lockfile && yarn build
|
make clean install dist
|
||||||
|
|
||||||
# Commit release
|
# Commit release
|
||||||
git add --force dist/
|
git add --force dist/
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"test": "jest",
|
"test": "jest",
|
||||||
"jest": "jest --notify --watch",
|
"jest": "jest --notify --watch",
|
||||||
"codecov": "jest --coverage && codecov",
|
"codecov": "jest --coverage && codecov",
|
||||||
"ci-test": "jest --coverage && codecov",
|
"ci-test": "jest --coverage",
|
||||||
"lint": "jshint --reporter=node_modules/jshint-stylish src/ & jscs src/",
|
"lint": "jshint --reporter=node_modules/jshint-stylish src/ & jscs src/",
|
||||||
"benchmark": "webpack --config webpack/webpack.bench.conf.js && grunt bench"
|
"benchmark": "webpack --config webpack/webpack.bench.conf.js && grunt bench"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user