Skip to content

Commit

Permalink
run CI as non-root user to speed up grpc module install
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster committed Jan 12, 2018
1 parent 1eaf15f commit eb71dda
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ jobs:
node4:
docker:
- image: node:4
user: node
steps:
- checkout
- run:
Expand All @@ -106,44 +107,57 @@ jobs:
node6:
docker:
- image: node:6
user: node
<<: *unit_tests
node7:
docker:
- image: node:7
user: node
<<: *unit_tests
node8:
docker:
- image: node:8
user: node
<<: *unit_tests
node9:
docker:
- image: node:9
user: node
<<: *unit_tests

lint:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
name: Install modules and dependencies.
command: |
mkdir /home/node/.npm-global
npm install
npm link
environment:
NPM_CONFIG_PREFIX: /home/node/.npm-global
- run:
name: Link the module being tested to the samples.
command: |
cd samples/
npm link @google-cloud/pubsub
npm install
cd ..
environment:
NPM_CONFIG_PREFIX: /home/node/.npm-global
- run:
name: Run linting.
command: npm run lint
environment:
NPM_CONFIG_PREFIX: /home/node/.npm-global

docs:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
Expand All @@ -156,6 +170,7 @@ jobs:
sample_tests:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
Expand All @@ -167,30 +182,37 @@ jobs:
- run:
name: Install and link the module.
command: |
mkdir /home/node/.npm-global
npm install
npm link
environment:
NPM_CONFIG_PREFIX: /home/node/.npm-global
- run:
name: Link the module being tested to the samples.
command: |
cd samples/
npm link @google-cloud/pubsub
npm install
cd ..
environment:
NPM_CONFIG_PREFIX: /home/node/.npm-global
- run:
name: Run sample tests.
command: npm run samples-test
environment:
GCLOUD_PROJECT: long-door-651
GOOGLE_APPLICATION_CREDENTIALS: /var/pubsub/.circleci/key.json
GOOGLE_APPLICATION_CREDENTIALS: /home/node/pubsub-samples/.circleci/key.json
NPM_CONFIG_PREFIX: /home/node/.npm-global
- run:
name: Remove unencrypted key.
command: rm .circleci/key.json
when: always
working_directory: /var/pubsub/
working_directory: /home/node/pubsub-samples

system_tests:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
Expand All @@ -215,6 +237,7 @@ jobs:
publish_npm:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
Expand Down

0 comments on commit eb71dda

Please sign in to comment.