Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make GreenKeeper lockfile updates strictly execute first in CI #275

Merged
merged 1 commit into from
Jul 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 52 additions & 39 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
version: 2

job_common: &job_common
docker:
- image: circleci/node:9.11.2
working_directory: ~/colonyNetwork
step_save_cache: &step_save_cache
save_cache:
paths:
- ~/.cache/yarn
key: node-modules-{{ checksum "yarn.lock" }}
step_restore_cache: &step_restore_cache
restore_cache:
keys:
- node-modules-{{ checksum "yarn.lock" }}
- node-modules-
step_setup_global_packages: &step_setup_global_packages
run:
name: "Set up global packages"
command: |
yarn --pure-lockfile
git submodule update --init
step_setup_greenkeeper: &step_setup_greenkeeper
run:
name: "Add greenkeeper-lockfile-update"
command: yarn global add greenkeeper-lockfile@1
jobs:
lint-and-unit-test:
docker:
- image: circleci/node:9.11.2
working_directory: ~/colonyNetwork
greenkeeper-updates:
<<: *job_common
steps:
- checkout
- restore_cache:
keys:
- node-modules-{{ checksum "yarn.lock" }}
- node-modules-
- <<: *step_restore_cache
- <<: *step_setup_global_packages
- <<: *step_setup_greenkeeper
- run:
name: "Set up global packages"
command: |
yarn global add greenkeeper-lockfile@1
yarn --pure-lockfile
git submodule update --init
name: "Run Greenkeeper lockfile update"
command: $(yarn global bin)/greenkeeper-lockfile-update
environment:
GK_LOCK_YARN_OPTS: "--ignore-workspace-root-check"
- <<: *step_save_cache
lint-and-unit-test:
<<: *job_common
steps:
- checkout
- <<: *step_restore_cache
- <<: *step_setup_global_packages
- <<: *step_setup_greenkeeper
- run:
name: "Setup parity"
command: |
Expand All @@ -28,20 +56,11 @@ jobs:
sed -i "s/xxxxx/$(parity --keys-path ./keys --password ./parityPassword account new)/g" ./parity-genesis.json
sed -i "s/yyyyy/$(parity --keys-path ./keys --password ./parityPassword account new)/g" ./parity-genesis.json
sed -i "s/zzzzz/$(parity --keys-path ./keys --password ./parityPassword account new)/g" ./parity-genesis.json
- save_cache:
paths:
- node_modules
key: node-modules-{{ checksum "yarn.lock" }}
- run:
name: "Install lsof"
command: |
sudo apt-get update
sudo apt-get install lsof
- run:
name: "Greenkeeper lockfile update"
command: $(yarn global bin)/greenkeeper-lockfile-update
environment:
GK_LOCK_YARN_OPTS: "--ignore-workspace-root-check"
- run:
name: "Linting JavaScript"
command: yarn run eslint
Expand All @@ -66,6 +85,7 @@ jobs:
- run:
name: "Running colony-contract-loader-network tests"
command: cd packages/colony-js-contract-loader-network && yarn run test
- <<: *step_save_cache
- run:
name: "Greenkeeper uploading lockfile"
command: $(yarn global bin)/greenkeeper-lockfile-upload
Expand All @@ -74,27 +94,15 @@ jobs:
path: test-results.xml
- store_artifacts:
path: test-results.xml

test-coverage:
docker:
- image: circleci/node:9.11.2
working_directory: ~/colonyNetwork
<<: *job_common
steps:
- checkout
- restore_cache:
keys:
- node-modules-{{ checksum "yarn.lock" }}
- node-modules-
- run:
name: "Set up global packages"
command: |
yarn global add greenkeeper-lockfile@1
yarn --pure-lockfile
git submodule update --init
- <<: *step_restore_cache
- <<: *step_setup_global_packages
- run:
name: "Running unit tests with coverage"
command: yarn run test:contracts:coverage

# Save coverage artifacts
- store_artifacts:
path: coverage
Expand All @@ -103,5 +111,10 @@ workflows:
version: 2
commit:
jobs:
- lint-and-unit-test
- test-coverage
- greenkeeper-updates
- lint-and-unit-test:
requires:
- greenkeeper-updates
- test-coverage:
requires:
- greenkeeper-updates