diff --git a/.circleci/config.yml b/.circleci/config.yml index fc8dc747ae..b8d6db96a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -235,6 +235,16 @@ anchor_run_php: &anchor_run_php name: Test PHP Logging client <<: *anchor_test_php +# Test a NodeJS client if generation succeeded. +anchor_test_nodejs_client: &anchor_test_nodejs_client + command: | + cd ${NODEJS_GEN_DIR}/${TEST_API} + npm install + # Copy over IAM protos. + cp -r node_modules/google-proto-files/google/iam/ protos/google/ + npm test + when: always + # ======================= JOBS ======================= jobs: @@ -419,7 +429,46 @@ jobs: <<: *anchor_auth_vars docker: - image: circleci/php:7.2.0-cli-stretch - + verify-and-test-nodejs-8: + working_directory: /tmp/ + environment: + LANGUAGE: nodejs + NODEJS_GEN_DIR: /tmp/workspace/gapic-generator/artman-genfiles/js + <<: *anchor_artman_vars + docker: + - image: circleci/node:8-stretch-browsers + steps: + - attach_workspace: + at: workspace + - run: + name: Verify all NodeJS generation succeeded + <<: *anchor_check_generation + - run: + name: Prepare to test Pubsub + command: | + echo 'export TEST_API="pubsub-v1"' >> $BASH_ENV + when: always + - run: + name: Test Node Pubsub client + <<: *anchor_test_nodejs_client + - run: + name: Prepare to test Speech + command: | + echo 'export TEST_API="speech-v1"' >> $BASH_ENV + when: always + - run: + name: Test Node Speech client + <<: *anchor_test_nodejs_client + - run: + name: Prepare to test Logging + command: | + echo 'export TEST_API="logging-v2"' >> $BASH_ENV + when: always + - run: + name: Test Node Logging client + <<: *anchor_test_nodejs_client + # Logging client needs common proto refresh before build will work: + # https://github.com/googleapis/gapic-generator/issues/2238 # TODO: test other language clients. # ======================= WORKFLOWS ======================= @@ -458,6 +507,9 @@ workflows: - generate-clients # TODO: php smoke tests # TODO: Other php versions + - verify-and-test-nodejs-8: + requires: + - generate-clients machine: services: diff --git a/generate_clients.py b/generate_clients.py index 83919eb45d..95ca04ed0e 100644 --- a/generate_clients.py +++ b/generate_clients.py @@ -34,6 +34,7 @@ "python", "ruby", "php", + "nodejs" # TODO: add other languages here. ]