-
Notifications
You must be signed in to change notification settings - Fork 598
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to the nodejs-language repo. (#7)
- Loading branch information
1 parent
75522f1
commit 5af4c4c
Showing
34 changed files
with
2,455 additions
and
1,619 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
environment: | ||
matrix: | ||
- nodejs_version: 4 | ||
- nodejs_version: 6 | ||
- nodejs_version: 7 | ||
- nodejs_version: 8 | ||
|
||
install: | ||
- ps: Install-Product node $env:nodejs_version | ||
- npm install -g npm # Force using the latest npm to get dedupe during install | ||
- set PATH=%APPDATA%\npm;%PATH% | ||
- npm install --force --ignore-scripts | ||
|
||
test_script: | ||
- node --version | ||
- npm --version | ||
- npm rebuild | ||
- npm test | ||
|
||
build: off | ||
|
||
matrix: | ||
fast_finish: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,221 @@ | ||
--- | ||
# "Include" for unit tests definition. | ||
unit_tests: &unit_tests | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install modules and dependencies. | ||
command: npm install | ||
- run: | ||
name: Run unit tests. | ||
command: npm test | ||
- run: | ||
name: Submit coverage data to codecov. | ||
command: node_modules/.bin/codecov | ||
when: always | ||
|
||
version: 2.0 | ||
workflows: | ||
version: 2 | ||
tests: | ||
jobs: | ||
- node4: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- node6: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- node7: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- node8: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- lint: | ||
requires: | ||
- node4 | ||
- node6 | ||
- node7 | ||
- node8 | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- docs: | ||
requires: | ||
- node4 | ||
- node6 | ||
- node7 | ||
- node8 | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- system_tests: | ||
requires: | ||
- lint | ||
- docs | ||
filters: | ||
branches: | ||
only: master | ||
tags: | ||
only: /^v[\d.]+$/ | ||
- sample_tests: | ||
requires: | ||
- lint | ||
- docs | ||
filters: | ||
branches: | ||
only: master | ||
tags: | ||
only: /^v[\d.]+$/ | ||
- publish_npm: | ||
requires: | ||
- system_tests | ||
- sample_tests | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^v[\d.]+$/ | ||
|
||
jobs: | ||
node4: | ||
docker: | ||
- image: node:4 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install modules and dependencies. | ||
command: npm install --unsafe-perm | ||
- run: | ||
name: Run unit tests. | ||
command: npm test | ||
- run: | ||
name: Submit coverage data to codecov. | ||
command: node_modules/.bin/codecov | ||
when: always | ||
node6: | ||
docker: | ||
- image: node:6 | ||
<<: *unit_tests | ||
node7: | ||
docker: | ||
- image: node:7 | ||
<<: *unit_tests | ||
node8: | ||
docker: | ||
- image: node:8 | ||
<<: *unit_tests | ||
|
||
lint: | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install modules and dependencies. | ||
command: npm install | ||
- run: | ||
name: Link the module being tested to the samples. | ||
command: | | ||
cd samples/ | ||
npm install | ||
npm link @google-cloud/language | ||
cd .. | ||
- run: | ||
name: Run linting. | ||
command: npm run lint | ||
|
||
docs: | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install modules and dependencies. | ||
command: npm install | ||
- run: | ||
name: Build documentation. | ||
command: npm run docs | ||
|
||
sample_tests: | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- checkout | ||
- 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: | | ||
npm install | ||
npm link | ||
- run: | ||
name: Link the module being tested to the samples. | ||
command: | | ||
cd samples/ | ||
npm install | ||
npm link @google-cloud/language | ||
cd .. | ||
- run: | ||
name: Run sample tests. | ||
command: npm run samples-test | ||
environment: | ||
GCLOUD_PROJECT: long-door-651 | ||
GOOGLE_APPLICATION_CREDENTIALS: /var/language/.circleci/key.json | ||
- run: | ||
name: Remove unencrypted key. | ||
command: rm .circleci/key.json | ||
when: always | ||
working_directory: /var/language/ | ||
|
||
system_tests: | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- checkout | ||
- 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: Decrypt second account credentials (storage-specific). | ||
command: | | ||
openssl aes-256-cbc -d -in .circleci/no-whitelist-key.json.enc \ | ||
-out .circleci/no-whitelist-key.json \ | ||
-k "${SYSTEM_TESTS_ENCRYPTION_KEY}" | ||
- run: | ||
name: Install modules and dependencies. | ||
command: npm install | ||
- run: | ||
name: Run system tests. | ||
command: npm run system-test | ||
environment: | ||
GCN_STORAGE_2ND_PROJECT_ID: gcloud-node-whitelist-ci-tests | ||
GCN_STORAGE_2ND_PROJECT_KEY: .circleci/no-whitelist-key.json | ||
GOOGLE_APPLICATION_CREDENTIALS: .circleci/key.json | ||
- run: | ||
name: Remove unencrypted key. | ||
command: rm .circleci/key.json | ||
when: always | ||
|
||
publish_npm: | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Set NPM authentication. | ||
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc | ||
- run: | ||
name: Publish the module to npm. | ||
command: npm publish |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"product": "nl", | ||
"requiresKeyFile": true, | ||
"requiresProjectId": true, | ||
"client_reference_url": "https://cloud.google.com/nodejs/docs/reference/natural-language/latest/", | ||
"release_quality": "beta", | ||
"samples": [ | ||
{ | ||
"id": "analyze-v1", | ||
"name": "Analyze v1", | ||
"file": "analyze.v1.js", | ||
"docs_link": "https://cloud.google.com/natural-language/docs/", | ||
"usage": "node analyze.v1.js --help" | ||
}, | ||
{ | ||
"id": "analyze-v1beta2", | ||
"name": "Analyze v1beta2", | ||
"file": "analyze.v1beta2.js", | ||
"docs_link": "https://cloud.google.com/natural-language/docs/", | ||
"usage": "node analyze.v1beta2.js --help" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/* | ||
samples/node_modules/* | ||
src/**/doc/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
extends: | ||
- 'eslint:recommended' | ||
- 'plugin:node/recommended' | ||
- prettier | ||
plugins: | ||
- node | ||
- prettier | ||
rules: | ||
prettier/prettier: error | ||
block-scoped-var: error | ||
eqeqeq: error | ||
no-warning-comments: warn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
**/*.log | ||
**/node_modules | ||
.coverage | ||
.nyc_output | ||
docs/ | ||
out/ | ||
system-test/secrets.js | ||
system-test/*key.json | ||
*.lock | ||
*-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/*! | ||
* Copyright 2017 Google Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports = { | ||
opts: { | ||
readme: './README.md', | ||
package: './package.json', | ||
template: './node_modules/ink-docstrap/template', | ||
recurse: true, | ||
verbose: true, | ||
destination: './docs/' | ||
}, | ||
plugins: [ | ||
'plugins/markdown' | ||
], | ||
source: { | ||
excludePattern: '(^|\\/|\\\\)[._]', | ||
include: [ | ||
'src' | ||
], | ||
includePattern: '\\.js$' | ||
}, | ||
templates: { | ||
copyright: 'Copyright 2017 Google, Inc.', | ||
includeDate: false, | ||
sourceFiles: false, | ||
systemName: '@google-cloud/language', | ||
theme: 'lumen' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Jason Dobry <[email protected]> Jason Dobry <[email protected]> | ||
Luke Sneeringer <[email protected]> Luke Sneeringer <[email protected]> | ||
Stephen Sawchuk <[email protected]> Stephen Sawchuk <[email protected]> | ||
Stephen Sawchuk <[email protected]> Stephen Sawchuk <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"report-dir": "./.coverage", | ||
"exclude": [ | ||
"src/*{/*,/**/*}.js", | ||
"src/*/v*/*.js", | ||
"test/**/*.js" | ||
], | ||
"watermarks": { | ||
"branches": [ | ||
95, | ||
100 | ||
], | ||
"functions": [ | ||
95, | ||
100 | ||
], | ||
"lines": [ | ||
95, | ||
100 | ||
], | ||
"statements": [ | ||
95, | ||
100 | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/* | ||
samples/node_modules/* | ||
src/**/doc/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
bracketSpacing: false | ||
printWidth: 80 | ||
semi: true | ||
singleQuote: true | ||
tabWidth: 2 | ||
trailingComma: es5 | ||
useTabs: false |
Oops, something went wrong.