diff --git a/.circleci/config.yml b/.circleci/config.yml index 02489ec9..b085e643 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,6 +83,7 @@ jobs: node4: docker: - image: node:4 + user: node steps: - checkout - run: @@ -98,30 +99,38 @@ 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 -p /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: | @@ -129,13 +138,18 @@ jobs: npm link dialogflow 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: @@ -148,6 +162,7 @@ jobs: sample_tests: docker: - image: node:8 + user: node steps: - checkout - run: @@ -159,8 +174,11 @@ jobs: - run: name: Install and link the module. command: | + mkdir -p /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: | @@ -168,21 +186,25 @@ jobs: npm link dialogflow 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/dialogflow/.circleci/key.json + GOOGLE_APPLICATION_CREDENTIALS: /home/node/dialogflow-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/dialogflow/ + working_directory: /home/node/dialogflow-samples system_tests: docker: - image: node:8 + user: node steps: - checkout - run: @@ -207,6 +229,7 @@ jobs: publish_npm: docker: - image: node:8 + user: node steps: - checkout - run: