Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
making lint and samples work in circle
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster committed Mar 24, 2018
1 parent d43ad19 commit f47d62e
Show file tree
Hide file tree
Showing 4 changed files with 11,860 additions and 3,579 deletions.
63 changes: 61 additions & 2 deletions .circleci/config.yml
Expand Up @@ -37,10 +37,18 @@ workflows:
filters:
tags:
only: /.*/
- publish_npm:
- sample_tests:
requires:
- lint
- docs
filters:
branches:
only: master
tags:
only: '/^v[\d.]+$/'
- publish_npm:
requires:
- sample_tests
filters:
branches:
ignore: /.*/
Expand Down Expand Up @@ -112,6 +120,15 @@ jobs:
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/text-to-speech
npm install
cd ..
environment:
NPM_CONFIG_PREFIX: /home/node/.npm-global
- run:
name: Run linting.
command: npm run lint
Expand All @@ -130,6 +147,48 @@ jobs:
- run:
name: Build documentation.
command: npm run docs
sample_tests:
docker:
- image: 'node:8'
user: node
steps:
- checkout
- run: *remove_package_lock
- run:
name: Decrypt credentials.
command: |
openssl aes-256-cbc -d -in .circleci/key.json.enc \
-out .circleci/key.json \
-k "${SYSTEM_TESTS_ENCRYPTION_KEY}"
- 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: |
cd samples/
npm link @google-cloud/text-to-speech
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: /home/node/text-to-speech-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: /home/node/text-to-speech-samples
publish_npm:
docker:
- image: 'node:8'
Expand All @@ -141,4 +200,4 @@ jobs:
command: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc'
- run:
name: Publish the module to npm.
command: npm publish --access=public
command: npm publish
Binary file added .circleci/key.json.enc
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -39,6 +39,7 @@
"test-no-cover": "repo-tools test run --cmd mocha -- test/*.js --no-timeouts",
"lint": "repo-tools lint --cmd eslint -- src/ samples/ system-test/ test/ smoke-test/",
"prettier": "repo-tools exec -- prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js smoke-test/*.js",
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
"docs": "repo-tools exec -- jsdoc -c .jsdoc.js"
},
"dependencies": {
Expand Down

0 comments on commit f47d62e

Please sign in to comment.