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: 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

View File

@@ -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/

View File

@@ -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"
}, },

3215
yarn.lock

File diff suppressed because it is too large Load Diff