diff --git a/.kokoro/lint.cfg b/.kokoro/lint.cfg new file mode 100644 index 0000000000..4e9f6f89f2 --- /dev/null +++ b/.kokoro/lint.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-docs-samples/.kokoro/lint.sh" +} diff --git a/.kokoro/lint.sh b/.kokoro/lint.sh new file mode 100644 index 0000000000..b867b484cc --- /dev/null +++ b/.kokoro/lint.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Copyright 2018 Google LLC. +# +# 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. + +export GCLOUD_PROJECT=nodejs-docs-samples-tests +export NODE_ENV=development + +cd github/nodejs-docs-samples/ + +# Install dependencies +npm install + +# Run lint +npm run lint + +exit $? diff --git a/circle.yml b/circle.yml deleted file mode 100644 index e5147bc8c0..0000000000 --- a/circle.yml +++ /dev/null @@ -1,124 +0,0 @@ -# Copyright 2017, Google, Inc. -# 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. - -# See: -# -# https://circleci.com/docs/configuration/ -# https://circleci.com/docs/install-and-use-yarn/ - -machine: - node: - version: 6.14.2 - -# Use for broader build-related configuration -general: - branches: - ignore: - - gh-pages - -# Install your project's language-specific dependencies -dependencies: - override: - - echo $KEYFILE > /home/ubuntu/nodejs-docs-samples/key.json - - gcloud auth activate-service-account --key-file /home/ubuntu/nodejs-docs-samples/key.json || true - - yarn global add ava nyc codecov @google-cloud/nodejs-repo-tools@1.4.17 @google-cloud/functions-emulator@1.0.0-beta.4 - - yarn install - - yarn run lint - - samples test install -l=functions/background - - samples test install -l=functions/concepts - - samples test install -l=functions/datastore - - samples test install -l=functions/errorreporting - - samples test install -l=functions/gcs - - samples test install -l=functions/helloworld - - samples test install -l=functions/http - - samples test install -l=functions/imagemagick - - samples test install -l=functions/log - - samples test install -l=functions/ocr/app - - samples test install -l=functions/pubsub - - samples test install -l=functions/sendgrid - - samples test install -l=functions/slack - - samples test install -l=functions/spanner - - samples test install -l=functions/tips - - samples test install -l=functions/uuid - cache_directories: - - ~/.cache/yarn - - functions/background/node_modules - - functions/concepts/node_modules - - functions/datastore/node_modules - - functions/errorreporting/node_modules - - functions/gcs/node_modules - - functions/helloworld/node_modules - - functions/http/node_modules - - functions/imagemagick/node_modules - - functions/log/node_modules - - functions/ocr/app/node_modules - - functions/pubsub/node_modules - - functions/sendgrid/node_modules - - functions/slack/node_modules - - functions/spanner/node_modules - - functions/tips/node_modules - - functions/uuid/node_modules - -# Run your tests -test: - override: - - export GCLOUD_PROJECT=nodejs-docs-samples-tests && functions-emulator start && cd functions/datastore && npm test && functions-emulator stop - # Only run if the PR is not coming from a fork. - - if [[ -z $CIRCLE_PR_USERNAME ]] ; then functions-emulator config set projectId $GCLOUD_PROJECT && functions-emulator start && cd functions/helloworld && npm test && functions-emulator stop; fi - - samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/background/test/**/*.test.js' - - samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/concepts/test/**/*.test.js' - - samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/gcs/test/**/*.test.js' - - samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/http/test/**/*.test.js' - - samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/imagemagick/test/**/*.test.js' - - samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/log/test/**/*.test.js' - - samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/pubsub/test/**/*.test.js' - - samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/sendgrid/test/**/*.test.js' - - samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/slack/test/**/*.test.js' - - samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/spanner/test/**/*.test.js' - - samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/uuid/test/**/*.test.js' - - samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/tips/test/**/*.test.js' - post: - - nyc report --reporter=lcov > coverage.lcov && codecov || true -deployment: - tests: - branch: /.*/ - owner: GoogleCloudPlatform - commands: - - node scripts/build "appengine/analytics" - - export SQL_PORT=3306; export INSTANCE_CONNECTION_NAME=$INSTANCE_CONNECTION_PREFIX-mysql; node scripts/build "appengine/cloudsql" -- --test-args "run system-test-proxy" - - export SQL_PORT=5432; export INSTANCE_CONNECTION_NAME=$INSTANCE_CONNECTION_PREFIX-pg; node scripts/build "appengine/cloudsql_postgresql" -- --test-args "run system-test-proxy" - - node scripts/build "appengine/datastore" - - node scripts/build "appengine/endpoints" - - node scripts/build "appengine/errorreporting" - - node scripts/build "appengine/hello-world/flexible" - - node scripts/build "appengine/hello-world/standard" - - node scripts/build "appengine/mailjet" - - node scripts/build "appengine/metadata/flexible" - - node scripts/build "appengine/metadata/standard" - - node scripts/build "appengine/static-files" - - GCLOUD_STORAGE_BUCKET=docs-samples-storage-flexible; node scripts/build "appengine/storage/flexible" - - GCLOUD_STORAGE_BUCKET=docs-samples-storage-standard; node scripts/build "appengine/storage/standard" - - node scripts/build "auth" - - node scripts/build "appengine/pubsub" - - export GCP_QUEUE=nodejs-test-queue-do-not-delete; node scripts/build "cloudtasks" - - node scripts/build "containerengine/hello-world" - - node scripts/build "debugger" - - node scripts/build "endpoints/getting-started" - # TODO(ace-n): Get this working again - # - node scripts/build "endpoints/getting-started-grpc" - - node scripts/build "error-reporting" - - node scripts/build "iot/manager" - - node scripts/build "kms" - - node scripts/build "language/slackbot" - - node scripts/build "storage-transfer" - - node scripts/build "trace"