From c7ae7d6b1d4c0a40fd9dec47ac3a2ae062fef0bf Mon Sep 17 00:00:00 2001 From: Marc Dougherty Date: Tue, 23 Jan 2024 21:20:42 -0800 Subject: [PATCH] feat(testing): convert CI testing to use Makefile actions (#3579) * chore: try manually updating one GHA workflow to use make * trivial edit so ai-platform/snippets tests are not skipped. * remove empty stanza * pushing, to refresh workflows. adding workflow dispatch for another testing option. * add env var for gcp project * directory name typo * update shared workflow to use Make * update unique workflows, and the util template these workflows do not use the shared test.yaml, and have slight customizations. Also cleans up some trailing whitespace found in these files. * fix bracket spacing * fix functions/slack directory * add path match for shared test.yaml workflow * add path match for reused workflow test.yaml * add c8 as a dev dependency for packages that use it for testing * fix: use the right project * run toplevel npm install before installing sample deps * Apply suggestions from code review Co-authored-by: Patti Shin --------- Co-authored-by: Patti Shin --- .github/workflows/ai-platform-snippets.yaml | 19 +++++----------- .github/workflows/appengine-analytics.yaml | 3 +++ .../appengine-building-an-app-build.yaml | 3 +++ .../appengine-building-an-app-update.yaml | 3 +++ .github/workflows/appengine-datastore.yaml | 3 +++ .github/workflows/appengine-endpoints.yaml | 3 +++ .../appengine-hello-world-flexible.yaml | 3 +++ .../appengine-hello-world-standard.yaml | 3 +++ .github/workflows/appengine-memcached.yaml | 3 +++ .../appengine-metadata-flexible.yaml | 3 +++ .../appengine-metadata-standard.yaml | 3 +++ .github/workflows/appengine-pubsub.yaml | 3 +++ .github/workflows/appengine-static-files.yaml | 3 +++ .../workflows/appengine-storage-flexible.yaml | 3 +++ .../workflows/appengine-storage-standard.yaml | 3 +++ .github/workflows/appengine-twilio.yaml | 3 +++ .github/workflows/appengine-typescript.yaml | 3 +++ .github/workflows/appengine-websockets.yaml | 3 +++ .github/workflows/asset-snippets.yaml | 3 +++ .github/workflows/auth.yaml | 3 +++ .github/workflows/batch.yaml | 3 +++ .github/workflows/cloud-language.yaml | 3 +++ .github/workflows/cloud-tasks-snippets.yaml | 3 +++ .../cloud-tasks-tutorial-gcf-app.yaml | 3 +++ .../cloud-tasks-tutorial-gcf-function.yaml | 3 +++ .github/workflows/cloudbuild.yaml | 3 +++ ...er-functions-composer-storage-trigger.yaml | 3 +++ .github/workflows/composer.yaml | 3 +++ .github/workflows/compute.yaml | 3 +++ .../workflows/contact-center-insights.yaml | 3 +++ .../container-analysis-snippets.yaml | 3 +++ .github/workflows/container.yaml | 3 +++ .../workflows/datacatalog-cloud-client.yaml | 3 +++ .github/workflows/datacatalog-quickstart.yaml | 3 +++ .github/workflows/datacatalog-snippets.yaml | 3 +++ .github/workflows/datalabeling.yaml | 3 +++ .github/workflows/dataproc.yaml | 3 +++ .github/workflows/datastore-functions.yaml | 3 +++ .github/workflows/dialogflow-cx.yaml | 22 +++++-------------- .github/workflows/dialogflow.yaml | 3 +++ .github/workflows/discoveryengine.yaml | 3 +++ .github/workflows/dlp.yaml | 3 +++ .github/workflows/document-ai.yaml | 3 +++ .github/workflows/document-warehouse.yaml | 3 +++ .../endpoints-getting-started-grpc.yaml | 3 +++ .../workflows/endpoints-getting-started.yaml | 3 +++ .github/workflows/error-reporting.yaml | 3 +++ .github/workflows/eventarc-generic.yaml | 3 +++ .github/workflows/functions-concepts.yaml | 3 +++ .github/workflows/functions-env_vars.yaml | 3 +++ .github/workflows/functions-firebase.yaml | 3 +++ .github/workflows/functions-helloworld.yaml | 3 +++ .github/workflows/functions-http.yaml | 3 +++ .../workflows/functions-log-helloWorld.yaml | 3 +++ .../workflows/functions-log-processEntry.yaml | 3 +++ .../functions-memorystore-redis.yaml | 3 +++ .github/workflows/functions-pubsub.yaml | 3 +++ .../workflows/functions-scheduleinstance.yaml | 3 +++ .github/workflows/functions-security.yaml | 3 +++ .github/workflows/functions-slack.yaml | 19 +++++----------- .github/workflows/functions-spanner.yaml | 3 +++ .../functions-speech-to-speech-functions.yaml | 3 +++ .github/workflows/functions-tips.yaml | 3 +++ .../functions-v2-autolabelinstance.yaml | 3 +++ .../functions-v2-cloudeventlogging.yaml | 3 +++ ...-v2-firebase-firestore-helloFirestore.yaml | 3 +++ ...s-v2-firebase-firestore-makeUpperCase.yaml | 3 +++ ...ebase-remote-config-helloRemoteConfig.yaml | 3 +++ .../functions-v2-firebase-rtdb-helloRTDB.yaml | 3 +++ .../workflows/functions-v2-helloauditlog.yaml | 3 +++ .../workflows/functions-v2-hellobigquery.yaml | 3 +++ .github/workflows/functions-v2-hellogcs.yaml | 3 +++ .../workflows/functions-v2-hellopubsub.yaml | 3 +++ .../workflows/functions-v2-httplogging.yaml | 3 +++ .../functions-v2-log-processEntry.yaml | 3 +++ .github/workflows/functions-v2-ocr-app.yaml | 3 +++ ...unctions-v2-tips-avoidInfiniteRetries.yaml | 3 +++ .../workflows/functions-v2-tips-retry.yaml | 3 +++ .../functions-v2-typed-googlechatbot.yaml | 3 +++ .../functions-v2-typed-greeting.yaml | 3 +++ .github/workflows/game-servers-snippets.yaml | 3 +++ .github/workflows/healthcare-consent.yaml | 3 +++ .github/workflows/healthcare-datasets.yaml | 3 +++ .github/workflows/healthcare-dicom.yaml | 3 +++ .github/workflows/healthcare-fhir.yaml | 3 +++ .github/workflows/healthcare-hl7v2.yaml | 3 +++ .github/workflows/kms.yaml | 3 +++ .github/workflows/media-livestream.yaml | 3 +++ .github/workflows/media-transcoder.yaml | 3 +++ .github/workflows/media-video-stitcher.yaml | 3 +++ .github/workflows/mediatranslation.yaml | 3 +++ .github/workflows/monitoring-opencensus.yaml | 3 +++ .github/workflows/monitoring-prometheus.yaml | 3 +++ .github/workflows/monitoring-snippets.yaml | 3 +++ .github/workflows/opencensus.yaml | 3 +++ .github/workflows/recaptcha-enterprise.yaml | 3 +++ .github/workflows/retail.yaml | 3 +++ .github/workflows/run-filesystem.yaml | 3 +++ .github/workflows/scheduler.yaml | 3 +++ .github/workflows/secret-manager.yaml | 3 +++ .../workflows/service-directory-snippets.yaml | 3 +++ .github/workflows/speech.yaml | 3 +++ .github/workflows/talent.yaml | 3 +++ .github/workflows/test.yaml | 22 +++++++------------ .github/workflows/texttospeech.yaml | 3 +++ .github/workflows/translate.yaml | 3 +++ .github/workflows/utils/ci-secrets.yaml.njk | 17 +++++--------- .github/workflows/video-intelligence.yaml | 3 +++ .github/workflows/vision-productSearch.yaml | 3 +++ .github/workflows/workflows.yaml | 3 +++ Makefile | 1 + ai-platform/snippets/package.json | 1 + document-warehouse/package.json | 3 ++- functions/env_vars/package.json | 1 + 114 files changed, 351 insertions(+), 69 deletions(-) diff --git a/.github/workflows/ai-platform-snippets.yaml b/.github/workflows/ai-platform-snippets.yaml index e9d1299340..f640028522 100644 --- a/.github/workflows/ai-platform-snippets.yaml +++ b/.github/workflows/ai-platform-snippets.yaml @@ -39,9 +39,6 @@ jobs: permissions: contents: 'read' id-token: 'write' - defaults: - run: - working-directory: 'ai-platform/snippets' steps: - uses: actions/checkout@v4.1.0 with: @@ -64,7 +61,7 @@ jobs: - name: Get npm cache directory id: npm-cache-dir shell: bash - run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} + run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} - uses: actions/cache@v3 id: npm-cache with: @@ -72,22 +69,18 @@ jobs: key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - - name: install repo dependencies - run: npm install - working-directory: . - - name: install directory dependencies - run: npm install - - run: npm run build --if-present - name: set env vars for scheduled run if: github.event.action == 'schedule' run: | echo "MOCHA_REPORTER_SUITENAME=ai-platform-snippets" >> $GITHUB_ENV echo "MOCHA_REPORTER_OUTPUT=${{github.run_id}}_sponge_log.xml" >> $GITHUB_ENV echo "MOCHA_REPORTER=xunit" >> $GITHUB_ENV - - run: npm test + - name: Run Tests + run: make test dir=ai-platform/snippets env: + GOOGLE_SAMPLES_PROJECT: "long-door-651" LOCATION: ${{ steps.secrets.outputs.location }} - CAIP_PROJECT_ID: ${{ steps.secrets.outputs.caip_id }} + CAIP_PROJECT_ID: ${{ steps.secrets.outputs.caip_id }} - name: upload test results for FlakyBot workflow if: github.event.action == 'schedule' && always() uses: actions/upload-artifact@v3 @@ -96,7 +89,7 @@ jobs: with: name: test-results path: ai-platform/snippets/${{ env.MOCHA_REPORTER_OUTPUT }} - retention-days: 1 + retention-days: 1 flakybot: permissions: contents: 'read' diff --git a/.github/workflows/appengine-analytics.yaml b/.github/workflows/appengine-analytics.yaml index 041411a73a..579290ebc1 100644 --- a/.github/workflows/appengine-analytics.yaml +++ b/.github/workflows/appengine-analytics.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/analytics/**' - '.github/workflows/appengine-analytics.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/analytics/**' - '.github/workflows/appengine-analytics.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/analytics/**' - '.github/workflows/appengine-analytics.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-building-an-app-build.yaml b/.github/workflows/appengine-building-an-app-build.yaml index 1b572a3e62..5d594d2e4b 100644 --- a/.github/workflows/appengine-building-an-app-build.yaml +++ b/.github/workflows/appengine-building-an-app-build.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/building-an-app/build/**' - '.github/workflows/appengine-building-an-app-build.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/building-an-app/build/**' - '.github/workflows/appengine-building-an-app-build.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/building-an-app/build/**' - '.github/workflows/appengine-building-an-app-build.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-building-an-app-update.yaml b/.github/workflows/appengine-building-an-app-update.yaml index f5b17076ed..f74ebe21cb 100644 --- a/.github/workflows/appengine-building-an-app-update.yaml +++ b/.github/workflows/appengine-building-an-app-update.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/building-an-app/update/**' - '.github/workflows/appengine-building-an-app-update.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/building-an-app/update/**' - '.github/workflows/appengine-building-an-app-update.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/building-an-app/update/**' - '.github/workflows/appengine-building-an-app-update.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-datastore.yaml b/.github/workflows/appengine-datastore.yaml index d62402a155..8003ebea0d 100644 --- a/.github/workflows/appengine-datastore.yaml +++ b/.github/workflows/appengine-datastore.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/datastore/**' - '.github/workflows/appengine-datastore.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/datastore/**' - '.github/workflows/appengine-datastore.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/datastore/**' - '.github/workflows/appengine-datastore.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-endpoints.yaml b/.github/workflows/appengine-endpoints.yaml index 50eb2f82c6..ea245e66cf 100644 --- a/.github/workflows/appengine-endpoints.yaml +++ b/.github/workflows/appengine-endpoints.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/endpoints/**' - '.github/workflows/appengine-endpoints.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/endpoints/**' - '.github/workflows/appengine-endpoints.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/endpoints/**' - '.github/workflows/appengine-endpoints.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-hello-world-flexible.yaml b/.github/workflows/appengine-hello-world-flexible.yaml index 41ddde557f..3aefe2a42a 100644 --- a/.github/workflows/appengine-hello-world-flexible.yaml +++ b/.github/workflows/appengine-hello-world-flexible.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/hello-world/flexible/**' - '.github/workflows/appengine-hello-world-flexible.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/hello-world/flexible/**' - '.github/workflows/appengine-hello-world-flexible.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/hello-world/flexible/**' - '.github/workflows/appengine-hello-world-flexible.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-hello-world-standard.yaml b/.github/workflows/appengine-hello-world-standard.yaml index d433b0ffb3..05c6987372 100644 --- a/.github/workflows/appengine-hello-world-standard.yaml +++ b/.github/workflows/appengine-hello-world-standard.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/hello-world/standard/**' - '.github/workflows/appengine-hello-world-standard.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/hello-world/standard/**' - '.github/workflows/appengine-hello-world-standard.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/hello-world/standard/**' - '.github/workflows/appengine-hello-world-standard.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-memcached.yaml b/.github/workflows/appengine-memcached.yaml index 482fb0b902..4549ecd314 100644 --- a/.github/workflows/appengine-memcached.yaml +++ b/.github/workflows/appengine-memcached.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/memcached/**' - '.github/workflows/appengine-memcached.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/memcached/**' - '.github/workflows/appengine-memcached.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/memcached/**' - '.github/workflows/appengine-memcached.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-metadata-flexible.yaml b/.github/workflows/appengine-metadata-flexible.yaml index 2965ce4536..783ed80ff8 100644 --- a/.github/workflows/appengine-metadata-flexible.yaml +++ b/.github/workflows/appengine-metadata-flexible.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/metadata/flexible/**' - '.github/workflows/appengine-metadata-flexible.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/metadata/flexible/**' - '.github/workflows/appengine-metadata-flexible.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/metadata/flexible/**' - '.github/workflows/appengine-metadata-flexible.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-metadata-standard.yaml b/.github/workflows/appengine-metadata-standard.yaml index 20bf29cfbd..2a2fb43d93 100644 --- a/.github/workflows/appengine-metadata-standard.yaml +++ b/.github/workflows/appengine-metadata-standard.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/metadata/standard/**' - '.github/workflows/appengine-metadata-standard.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/metadata/standard/**' - '.github/workflows/appengine-metadata-standard.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/metadata/standard/**' - '.github/workflows/appengine-metadata-standard.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-pubsub.yaml b/.github/workflows/appengine-pubsub.yaml index 3ebfdc6010..f784488e41 100644 --- a/.github/workflows/appengine-pubsub.yaml +++ b/.github/workflows/appengine-pubsub.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/pubsub/**' - '.github/workflows/appengine-pubsub.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/pubsub/**' - '.github/workflows/appengine-pubsub.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/pubsub/**' - '.github/workflows/appengine-pubsub.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-static-files.yaml b/.github/workflows/appengine-static-files.yaml index 75b1df1c00..be94009eac 100644 --- a/.github/workflows/appengine-static-files.yaml +++ b/.github/workflows/appengine-static-files.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/static-files/**' - '.github/workflows/appengine-static-files.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/static-files/**' - '.github/workflows/appengine-static-files.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/static-files/**' - '.github/workflows/appengine-static-files.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-storage-flexible.yaml b/.github/workflows/appengine-storage-flexible.yaml index 94da243668..319e976b4d 100644 --- a/.github/workflows/appengine-storage-flexible.yaml +++ b/.github/workflows/appengine-storage-flexible.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/storage/flexible/**' - '.github/workflows/appengine-storage-flexible.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/storage/flexible/**' - '.github/workflows/appengine-storage-flexible.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/storage/flexible/**' - '.github/workflows/appengine-storage-flexible.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-storage-standard.yaml b/.github/workflows/appengine-storage-standard.yaml index 273b8e0f27..1dee26ae21 100644 --- a/.github/workflows/appengine-storage-standard.yaml +++ b/.github/workflows/appengine-storage-standard.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/storage/standard/**' - '.github/workflows/appengine-storage-standard.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/storage/standard/**' - '.github/workflows/appengine-storage-standard.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/storage/standard/**' - '.github/workflows/appengine-storage-standard.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-twilio.yaml b/.github/workflows/appengine-twilio.yaml index cabee68850..9019416722 100644 --- a/.github/workflows/appengine-twilio.yaml +++ b/.github/workflows/appengine-twilio.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/twilio/**' - '.github/workflows/appengine-twilio.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/twilio/**' - '.github/workflows/appengine-twilio.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/twilio/**' - '.github/workflows/appengine-twilio.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-typescript.yaml b/.github/workflows/appengine-typescript.yaml index 60ef4af9ea..dc3401d25a 100644 --- a/.github/workflows/appengine-typescript.yaml +++ b/.github/workflows/appengine-typescript.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/typescript/**' - '.github/workflows/appengine-typescript.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/typescript/**' - '.github/workflows/appengine-typescript.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/typescript/**' - '.github/workflows/appengine-typescript.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/appengine-websockets.yaml b/.github/workflows/appengine-websockets.yaml index 195b54c479..709e8d6d14 100644 --- a/.github/workflows/appengine-websockets.yaml +++ b/.github/workflows/appengine-websockets.yaml @@ -20,15 +20,18 @@ on: paths: - 'appengine/websockets/**' - '.github/workflows/appengine-websockets.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'appengine/websockets/**' - '.github/workflows/appengine-websockets.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'appengine/websockets/**' - '.github/workflows/appengine-websockets.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/asset-snippets.yaml b/.github/workflows/asset-snippets.yaml index f01c76cd5c..e07ce7cedc 100644 --- a/.github/workflows/asset-snippets.yaml +++ b/.github/workflows/asset-snippets.yaml @@ -20,15 +20,18 @@ on: paths: - 'asset/snippets/**' - '.github/workflows/asset-snippets.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'asset/snippets/**' - '.github/workflows/asset-snippets.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'asset/snippets/**' - '.github/workflows/asset-snippets.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/auth.yaml b/.github/workflows/auth.yaml index 068a695295..01a4a10c72 100644 --- a/.github/workflows/auth.yaml +++ b/.github/workflows/auth.yaml @@ -20,15 +20,18 @@ on: paths: - 'auth/**' - '.github/workflows/auth.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'auth/**' - '.github/workflows/auth.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'auth/**' - '.github/workflows/auth.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/batch.yaml b/.github/workflows/batch.yaml index 8de622f6df..2dc45a63f1 100644 --- a/.github/workflows/batch.yaml +++ b/.github/workflows/batch.yaml @@ -20,15 +20,18 @@ on: paths: - 'batch/**' - '.github/workflows/batch.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'batch/**' - '.github/workflows/batch.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'batch/**' - '.github/workflows/batch.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/cloud-language.yaml b/.github/workflows/cloud-language.yaml index fa5d3fb805..9cd10c7bd6 100644 --- a/.github/workflows/cloud-language.yaml +++ b/.github/workflows/cloud-language.yaml @@ -20,15 +20,18 @@ on: paths: - 'cloud-language/**' - '.github/workflows/cloud-language.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'cloud-language/**' - '.github/workflows/cloud-language.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'cloud-language/**' - '.github/workflows/cloud-language.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/cloud-tasks-snippets.yaml b/.github/workflows/cloud-tasks-snippets.yaml index 1475f69c32..381effe6cb 100644 --- a/.github/workflows/cloud-tasks-snippets.yaml +++ b/.github/workflows/cloud-tasks-snippets.yaml @@ -20,15 +20,18 @@ on: paths: - 'cloud-tasks/snippets/**' - '.github/workflows/cloud-tasks-snippets.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'cloud-tasks/snippets/**' - '.github/workflows/cloud-tasks-snippets.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'cloud-tasks/snippets/**' - '.github/workflows/cloud-tasks-snippets.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/cloud-tasks-tutorial-gcf-app.yaml b/.github/workflows/cloud-tasks-tutorial-gcf-app.yaml index 26d4336ef4..3dfc3a5d78 100644 --- a/.github/workflows/cloud-tasks-tutorial-gcf-app.yaml +++ b/.github/workflows/cloud-tasks-tutorial-gcf-app.yaml @@ -20,15 +20,18 @@ on: paths: - 'cloud-tasks/tutorial-gcf/app/**' - '.github/workflows/cloud-tasks-tutorial-gcf-app.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'cloud-tasks/tutorial-gcf/app/**' - '.github/workflows/cloud-tasks-tutorial-gcf-app.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'cloud-tasks/tutorial-gcf/app/**' - '.github/workflows/cloud-tasks-tutorial-gcf-app.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/cloud-tasks-tutorial-gcf-function.yaml b/.github/workflows/cloud-tasks-tutorial-gcf-function.yaml index cd218e6151..f5af41a458 100644 --- a/.github/workflows/cloud-tasks-tutorial-gcf-function.yaml +++ b/.github/workflows/cloud-tasks-tutorial-gcf-function.yaml @@ -20,15 +20,18 @@ on: paths: - 'cloud-tasks/tutorial-gcf/function/**' - '.github/workflows/cloud-tasks-tutorial-gcf-function.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'cloud-tasks/tutorial-gcf/function/**' - '.github/workflows/cloud-tasks-tutorial-gcf-function.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'cloud-tasks/tutorial-gcf/function/**' - '.github/workflows/cloud-tasks-tutorial-gcf-function.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/cloudbuild.yaml b/.github/workflows/cloudbuild.yaml index f6a126acf2..88d6212db1 100644 --- a/.github/workflows/cloudbuild.yaml +++ b/.github/workflows/cloudbuild.yaml @@ -20,15 +20,18 @@ on: paths: - 'cloudbuild/**' - '.github/workflows/cloudbuild.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'cloudbuild/**' - '.github/workflows/cloudbuild.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'cloudbuild/**' - '.github/workflows/cloudbuild.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/composer-functions-composer-storage-trigger.yaml b/.github/workflows/composer-functions-composer-storage-trigger.yaml index 8167c61f32..23e5f4c609 100644 --- a/.github/workflows/composer-functions-composer-storage-trigger.yaml +++ b/.github/workflows/composer-functions-composer-storage-trigger.yaml @@ -20,15 +20,18 @@ on: paths: - 'composer/functions/composer-storage-trigger/**' - '.github/workflows/composer-functions-composer-storage-trigger.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'composer/functions/composer-storage-trigger/**' - '.github/workflows/composer-functions-composer-storage-trigger.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'composer/functions/composer-storage-trigger/**' - '.github/workflows/composer-functions-composer-storage-trigger.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/composer.yaml b/.github/workflows/composer.yaml index 616ee45fc9..cba9c4065d 100644 --- a/.github/workflows/composer.yaml +++ b/.github/workflows/composer.yaml @@ -20,15 +20,18 @@ on: paths: - 'composer/**' - '.github/workflows/composer.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'composer/**' - '.github/workflows/composer.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'composer/**' - '.github/workflows/composer.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/compute.yaml b/.github/workflows/compute.yaml index 979b46dd61..4ee79afc22 100644 --- a/.github/workflows/compute.yaml +++ b/.github/workflows/compute.yaml @@ -20,15 +20,18 @@ on: paths: - 'compute/**' - '.github/workflows/compute.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'compute/**' - '.github/workflows/compute.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'compute/**' - '.github/workflows/compute.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/contact-center-insights.yaml b/.github/workflows/contact-center-insights.yaml index 05b9a32b1f..3cf83b46de 100644 --- a/.github/workflows/contact-center-insights.yaml +++ b/.github/workflows/contact-center-insights.yaml @@ -20,15 +20,18 @@ on: paths: - 'contact-center-insights/**' - '.github/workflows/contact-center-insights.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'contact-center-insights/**' - '.github/workflows/contact-center-insights.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'contact-center-insights/**' - '.github/workflows/contact-center-insights.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/container-analysis-snippets.yaml b/.github/workflows/container-analysis-snippets.yaml index 866a43f196..768840534f 100644 --- a/.github/workflows/container-analysis-snippets.yaml +++ b/.github/workflows/container-analysis-snippets.yaml @@ -20,15 +20,18 @@ on: paths: - 'container-analysis/snippets/**' - '.github/workflows/container-analysis-snippets.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'container-analysis/snippets/**' - '.github/workflows/container-analysis-snippets.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'container-analysis/snippets/**' - '.github/workflows/container-analysis-snippets.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/container.yaml b/.github/workflows/container.yaml index 641c54199f..e0165a47a4 100644 --- a/.github/workflows/container.yaml +++ b/.github/workflows/container.yaml @@ -20,15 +20,18 @@ on: paths: - 'container/**' - '.github/workflows/container.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'container/**' - '.github/workflows/container.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'container/**' - '.github/workflows/container.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/datacatalog-cloud-client.yaml b/.github/workflows/datacatalog-cloud-client.yaml index b373024660..06b4e41da8 100644 --- a/.github/workflows/datacatalog-cloud-client.yaml +++ b/.github/workflows/datacatalog-cloud-client.yaml @@ -20,15 +20,18 @@ on: paths: - 'datacatalog/cloud-client/**' - '.github/workflows/datacatalog-cloud-client.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'datacatalog/cloud-client/**' - '.github/workflows/datacatalog-cloud-client.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'datacatalog/cloud-client/**' - '.github/workflows/datacatalog-cloud-client.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/datacatalog-quickstart.yaml b/.github/workflows/datacatalog-quickstart.yaml index 64275a333d..ff689414bd 100644 --- a/.github/workflows/datacatalog-quickstart.yaml +++ b/.github/workflows/datacatalog-quickstart.yaml @@ -20,15 +20,18 @@ on: paths: - 'datacatalog/quickstart/**' - '.github/workflows/datacatalog-quickstart.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'datacatalog/quickstart/**' - '.github/workflows/datacatalog-quickstart.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'datacatalog/quickstart/**' - '.github/workflows/datacatalog-quickstart.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/datacatalog-snippets.yaml b/.github/workflows/datacatalog-snippets.yaml index 4d54154dcb..2dba3c61c2 100644 --- a/.github/workflows/datacatalog-snippets.yaml +++ b/.github/workflows/datacatalog-snippets.yaml @@ -20,15 +20,18 @@ on: paths: - 'datacatalog/snippets/**' - '.github/workflows/datacatalog-snippets.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'datacatalog/snippets/**' - '.github/workflows/datacatalog-snippets.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'datacatalog/snippets/**' - '.github/workflows/datacatalog-snippets.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/datalabeling.yaml b/.github/workflows/datalabeling.yaml index 7de8f8eebe..9f338939a0 100644 --- a/.github/workflows/datalabeling.yaml +++ b/.github/workflows/datalabeling.yaml @@ -20,15 +20,18 @@ on: paths: - 'datalabeling/**' - '.github/workflows/datalabeling.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'datalabeling/**' - '.github/workflows/datalabeling.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'datalabeling/**' - '.github/workflows/datalabeling.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/dataproc.yaml b/.github/workflows/dataproc.yaml index 739a6449ef..1eeff45570 100644 --- a/.github/workflows/dataproc.yaml +++ b/.github/workflows/dataproc.yaml @@ -20,15 +20,18 @@ on: paths: - 'dataproc/**' - '.github/workflows/dataproc.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'dataproc/**' - '.github/workflows/dataproc.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'dataproc/**' - '.github/workflows/dataproc.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/datastore-functions.yaml b/.github/workflows/datastore-functions.yaml index 6891c70cdf..b789f91d74 100644 --- a/.github/workflows/datastore-functions.yaml +++ b/.github/workflows/datastore-functions.yaml @@ -20,15 +20,18 @@ on: paths: - 'datastore/functions/**' - '.github/workflows/datastore-functions.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'datastore/functions/**' - '.github/workflows/datastore-functions.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'datastore/functions/**' - '.github/workflows/datastore-functions.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/dialogflow-cx.yaml b/.github/workflows/dialogflow-cx.yaml index a88267a17e..d190af120b 100644 --- a/.github/workflows/dialogflow-cx.yaml +++ b/.github/workflows/dialogflow-cx.yaml @@ -39,12 +39,6 @@ jobs: if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' runs-on: ubuntu-latest timeout-minutes: 120 - permissions: - contents: 'read' - id-token: 'write' - defaults: - run: - working-directory: 'dialogflow-cx' steps: - uses: actions/checkout@v4.1.0 with: @@ -67,28 +61,24 @@ jobs: - name: Get npm cache directory id: npm-cache-dir shell: bash - run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} + run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} - uses: actions/cache@v3 id: npm-cache with: path: ${{ steps.npm-cache-dir.outputs.dir }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | - ${{ runner.os }}-node- - - name: install repo dependencies - run: npm install - working-directory: . - - name: install directory dependencies - run: npm install - - run: npm run build --if-present + ${{ runner.os }}-node- - name: set env vars for scheduled run if: github.event.action == 'schedule' run: | echo "MOCHA_REPORTER_SUITENAME=dialogflow-cx" >> $GITHUB_ENV echo "MOCHA_REPORTER_OUTPUT=${{github.run_id}}_sponge_log.xml" >> $GITHUB_ENV echo "MOCHA_REPORTER=xunit" >> $GITHUB_ENV - - run: npm test + - name: Run Tests + run: make test dir=dialogflow-cx env: + GOOGLE_SAMPLES_PROJECT: "long-door-651" AGENT_ID: ${{ steps.secrets.outputs.agent_id }} TEST_ID: ${{ steps.secrets.outputs.test_id }} AGENT_PROJECT_ID: nodejs-docs-samples-tests @@ -100,7 +90,7 @@ jobs: with: name: test-results path: dialogflow-cx/${{ env.MOCHA_REPORTER_OUTPUT }} - retention-days: 1 + retention-days: 1 flakybot: permissions: contents: 'read' diff --git a/.github/workflows/dialogflow.yaml b/.github/workflows/dialogflow.yaml index 39f1893e52..28cdb673e0 100644 --- a/.github/workflows/dialogflow.yaml +++ b/.github/workflows/dialogflow.yaml @@ -20,15 +20,18 @@ on: paths: - 'dialogflow/**' - '.github/workflows/dialogflow.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'dialogflow/**' - '.github/workflows/dialogflow.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'dialogflow/**' - '.github/workflows/dialogflow.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/discoveryengine.yaml b/.github/workflows/discoveryengine.yaml index 2116fc6267..07583d8435 100644 --- a/.github/workflows/discoveryengine.yaml +++ b/.github/workflows/discoveryengine.yaml @@ -20,15 +20,18 @@ on: paths: - 'discoveryengine/**' - '.github/workflows/discoveryengine.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'discoveryengine/**' - '.github/workflows/discoveryengine.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'discoveryengine/**' - '.github/workflows/discoveryengine.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/dlp.yaml b/.github/workflows/dlp.yaml index f7f4ddd8e6..b21eb2ba64 100644 --- a/.github/workflows/dlp.yaml +++ b/.github/workflows/dlp.yaml @@ -20,15 +20,18 @@ on: paths: - 'dlp/**' - '.github/workflows/dlp.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'dlp/**' - '.github/workflows/dlp.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'dlp/**' - '.github/workflows/dlp.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/document-ai.yaml b/.github/workflows/document-ai.yaml index b250da71c5..e70d7b5fe1 100644 --- a/.github/workflows/document-ai.yaml +++ b/.github/workflows/document-ai.yaml @@ -20,15 +20,18 @@ on: paths: - 'document-ai/**' - '.github/workflows/document-ai.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'document-ai/**' - '.github/workflows/document-ai.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'document-ai/**' - '.github/workflows/document-ai.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/document-warehouse.yaml b/.github/workflows/document-warehouse.yaml index dfcb9eb340..a3aabce462 100644 --- a/.github/workflows/document-warehouse.yaml +++ b/.github/workflows/document-warehouse.yaml @@ -20,15 +20,18 @@ on: paths: - 'document-warehouse/**' - '.github/workflows/document-warehouse.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'document-warehouse/**' - '.github/workflows/document-warehouse.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'document-warehouse/**' - '.github/workflows/document-warehouse.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/endpoints-getting-started-grpc.yaml b/.github/workflows/endpoints-getting-started-grpc.yaml index 0d8663fdd3..c8f36ff77d 100644 --- a/.github/workflows/endpoints-getting-started-grpc.yaml +++ b/.github/workflows/endpoints-getting-started-grpc.yaml @@ -20,15 +20,18 @@ on: paths: - 'endpoints/getting-started-grpc/**' - '.github/workflows/endpoints-getting-started-grpc.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'endpoints/getting-started-grpc/**' - '.github/workflows/endpoints-getting-started-grpc.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'endpoints/getting-started-grpc/**' - '.github/workflows/endpoints-getting-started-grpc.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/endpoints-getting-started.yaml b/.github/workflows/endpoints-getting-started.yaml index e9cc0ac447..d8ec8025b2 100644 --- a/.github/workflows/endpoints-getting-started.yaml +++ b/.github/workflows/endpoints-getting-started.yaml @@ -20,15 +20,18 @@ on: paths: - 'endpoints/getting-started/**' - '.github/workflows/endpoints-getting-started.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'endpoints/getting-started/**' - '.github/workflows/endpoints-getting-started.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'endpoints/getting-started/**' - '.github/workflows/endpoints-getting-started.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/error-reporting.yaml b/.github/workflows/error-reporting.yaml index 6806f942c9..16783257e7 100644 --- a/.github/workflows/error-reporting.yaml +++ b/.github/workflows/error-reporting.yaml @@ -20,15 +20,18 @@ on: paths: - 'error-reporting/**' - '.github/workflows/error-reporting.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'error-reporting/**' - '.github/workflows/error-reporting.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'error-reporting/**' - '.github/workflows/error-reporting.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/eventarc-generic.yaml b/.github/workflows/eventarc-generic.yaml index e9cc8cc77a..3d2582f4e8 100644 --- a/.github/workflows/eventarc-generic.yaml +++ b/.github/workflows/eventarc-generic.yaml @@ -20,15 +20,18 @@ on: paths: - 'eventarc/generic/**' - '.github/workflows/eventarc-generic.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'eventarc/generic/**' - '.github/workflows/eventarc-generic.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'eventarc/generic/**' - '.github/workflows/eventarc-generic.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-concepts.yaml b/.github/workflows/functions-concepts.yaml index b6b55b1c22..511c0119a0 100644 --- a/.github/workflows/functions-concepts.yaml +++ b/.github/workflows/functions-concepts.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/concepts/**' - '.github/workflows/functions-concepts.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/concepts/**' - '.github/workflows/functions-concepts.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/concepts/**' - '.github/workflows/functions-concepts.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-env_vars.yaml b/.github/workflows/functions-env_vars.yaml index 08ca8ae835..7171a60833 100644 --- a/.github/workflows/functions-env_vars.yaml +++ b/.github/workflows/functions-env_vars.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/env_vars/**' - '.github/workflows/functions-env_vars.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/env_vars/**' - '.github/workflows/functions-env_vars.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/env_vars/**' - '.github/workflows/functions-env_vars.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-firebase.yaml b/.github/workflows/functions-firebase.yaml index 2b642572df..cb086652b5 100644 --- a/.github/workflows/functions-firebase.yaml +++ b/.github/workflows/functions-firebase.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/firebase/**' - '.github/workflows/functions-firebase.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/firebase/**' - '.github/workflows/functions-firebase.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/firebase/**' - '.github/workflows/functions-firebase.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-helloworld.yaml b/.github/workflows/functions-helloworld.yaml index 2b2179d9de..3a1a746a3d 100644 --- a/.github/workflows/functions-helloworld.yaml +++ b/.github/workflows/functions-helloworld.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/helloworld/**' - '.github/workflows/functions-helloworld.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/helloworld/**' - '.github/workflows/functions-helloworld.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/helloworld/**' - '.github/workflows/functions-helloworld.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-http.yaml b/.github/workflows/functions-http.yaml index 6369c2efaa..03df4add0f 100644 --- a/.github/workflows/functions-http.yaml +++ b/.github/workflows/functions-http.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/http/**' - '.github/workflows/functions-http.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/http/**' - '.github/workflows/functions-http.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/http/**' - '.github/workflows/functions-http.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-log-helloWorld.yaml b/.github/workflows/functions-log-helloWorld.yaml index 469eca1d5d..8f0069d459 100644 --- a/.github/workflows/functions-log-helloWorld.yaml +++ b/.github/workflows/functions-log-helloWorld.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/log/helloWorld/**' - '.github/workflows/functions-log-helloWorld.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/log/helloWorld/**' - '.github/workflows/functions-log-helloWorld.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/log/helloWorld/**' - '.github/workflows/functions-log-helloWorld.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-log-processEntry.yaml b/.github/workflows/functions-log-processEntry.yaml index 14db9486e4..208af09636 100644 --- a/.github/workflows/functions-log-processEntry.yaml +++ b/.github/workflows/functions-log-processEntry.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/log/processEntry/**' - '.github/workflows/functions-log-processEntry.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/log/processEntry/**' - '.github/workflows/functions-log-processEntry.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/log/processEntry/**' - '.github/workflows/functions-log-processEntry.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-memorystore-redis.yaml b/.github/workflows/functions-memorystore-redis.yaml index 1db762c321..239ab8e260 100644 --- a/.github/workflows/functions-memorystore-redis.yaml +++ b/.github/workflows/functions-memorystore-redis.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/memorystore/redis/**' - '.github/workflows/functions-memorystore-redis.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/memorystore/redis/**' - '.github/workflows/functions-memorystore-redis.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/memorystore/redis/**' - '.github/workflows/functions-memorystore-redis.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-pubsub.yaml b/.github/workflows/functions-pubsub.yaml index 08790d321a..9a360a254a 100644 --- a/.github/workflows/functions-pubsub.yaml +++ b/.github/workflows/functions-pubsub.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/pubsub/**' - '.github/workflows/functions-pubsub.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/pubsub/**' - '.github/workflows/functions-pubsub.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/pubsub/**' - '.github/workflows/functions-pubsub.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-scheduleinstance.yaml b/.github/workflows/functions-scheduleinstance.yaml index ed047be3e0..e43f035b03 100644 --- a/.github/workflows/functions-scheduleinstance.yaml +++ b/.github/workflows/functions-scheduleinstance.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/scheduleinstance/**' - '.github/workflows/functions-scheduleinstance.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/scheduleinstance/**' - '.github/workflows/functions-scheduleinstance.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/scheduleinstance/**' - '.github/workflows/functions-scheduleinstance.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-security.yaml b/.github/workflows/functions-security.yaml index 532042d13a..c526bddfde 100644 --- a/.github/workflows/functions-security.yaml +++ b/.github/workflows/functions-security.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/security/**' - '.github/workflows/functions-security.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/security/**' - '.github/workflows/functions-security.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/security/**' - '.github/workflows/functions-security.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-slack.yaml b/.github/workflows/functions-slack.yaml index 386bc04bdb..fdf8ede75c 100644 --- a/.github/workflows/functions-slack.yaml +++ b/.github/workflows/functions-slack.yaml @@ -39,9 +39,6 @@ jobs: if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' runs-on: ubuntu-latest timeout-minutes: 120 - defaults: - run: - working-directory: 'functions/slack' steps: - uses: actions/checkout@v4.1.0 with: @@ -64,28 +61,24 @@ jobs: - name: Get npm cache directory id: npm-cache-dir shell: bash - run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} + run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} - uses: actions/cache@v3 id: npm-cache with: path: ${{ steps.npm-cache-dir.outputs.dir }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | - ${{ runner.os }}-node- - - name: install repo dependencies - run: npm install - working-directory: . - - name: install directory dependencies - run: npm install - - run: npm run build --if-present + ${{ runner.os }}-node- - name: set env vars for scheduled run if: github.event.action == 'schedule' run: | echo "MOCHA_REPORTER_SUITENAME=functions-slack" >> $GITHUB_ENV echo "MOCHA_REPORTER_OUTPUT=${{github.run_id}}_sponge_log.xml" >> $GITHUB_ENV echo "MOCHA_REPORTER=xunit" >> $GITHUB_ENV - - run: npm test + - name: Run Tests + run: make test dir=functions/slack env: + GOOGLE_SAMPLES_PROJECT: "long-door-651" SLACK_SECRET: ${{ steps.secrets.outputs.slack_secret }} KG_API_KEY: ${{ steps.secrets.outputs.kg_api_key }} - name: upload test results for FlakyBot workflow @@ -96,7 +89,7 @@ jobs: with: name: test-results path: functions/slack/${{ env.MOCHA_REPORTER_OUTPUT }} - retention-days: 1 + retention-days: 1 flakybot: permissions: contents: 'read' diff --git a/.github/workflows/functions-spanner.yaml b/.github/workflows/functions-spanner.yaml index 1ccbb1b9d9..7d790b9fdc 100644 --- a/.github/workflows/functions-spanner.yaml +++ b/.github/workflows/functions-spanner.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/spanner/**' - '.github/workflows/functions-spanner.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/spanner/**' - '.github/workflows/functions-spanner.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/spanner/**' - '.github/workflows/functions-spanner.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-speech-to-speech-functions.yaml b/.github/workflows/functions-speech-to-speech-functions.yaml index 539319c0e3..2f865fffb2 100644 --- a/.github/workflows/functions-speech-to-speech-functions.yaml +++ b/.github/workflows/functions-speech-to-speech-functions.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/speech-to-speech/functions/**' - '.github/workflows/functions-speech-to-speech-functions.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/speech-to-speech/functions/**' - '.github/workflows/functions-speech-to-speech-functions.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/speech-to-speech/functions/**' - '.github/workflows/functions-speech-to-speech-functions.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-tips.yaml b/.github/workflows/functions-tips.yaml index b3bbaa4528..77f47eae8e 100644 --- a/.github/workflows/functions-tips.yaml +++ b/.github/workflows/functions-tips.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/tips/**' - '.github/workflows/functions-tips.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/tips/**' - '.github/workflows/functions-tips.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/tips/**' - '.github/workflows/functions-tips.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-autolabelinstance.yaml b/.github/workflows/functions-v2-autolabelinstance.yaml index 7331e66d95..bdc4de9e01 100644 --- a/.github/workflows/functions-v2-autolabelinstance.yaml +++ b/.github/workflows/functions-v2-autolabelinstance.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/autoLabelInstance/**' - '.github/workflows/functions-v2-autoLabelInstance.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/autoLabelInstance/**' - '.github/workflows/functions-v2-autoLabelInstance.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/autoLabelInstance/**' - '.github/workflows/functions-v2-autoLabelInstance.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-cloudeventlogging.yaml b/.github/workflows/functions-v2-cloudeventlogging.yaml index 847a590ae0..c81b656a9a 100644 --- a/.github/workflows/functions-v2-cloudeventlogging.yaml +++ b/.github/workflows/functions-v2-cloudeventlogging.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/cloudEventLogging/**' - '.github/workflows/functions-v2-cloudEventLogging.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/cloudEventLogging/**' - '.github/workflows/functions-v2-cloudEventLogging.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/cloudEventLogging/**' - '.github/workflows/functions-v2-cloudEventLogging.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-firebase-firestore-helloFirestore.yaml b/.github/workflows/functions-v2-firebase-firestore-helloFirestore.yaml index c0157a4745..9c5a415b1a 100644 --- a/.github/workflows/functions-v2-firebase-firestore-helloFirestore.yaml +++ b/.github/workflows/functions-v2-firebase-firestore-helloFirestore.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/firebase/firestore/helloFirestore/**' - '.github/workflows/functions-v2-firebase-firestore-helloFirestore.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/firebase/firestore/helloFirestore/**' - '.github/workflows/functions-v2-firebase-firestore-helloFirestore.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/firebase/firestore/helloFirestore/**' - '.github/workflows/functions-v2-firebase-firestore-helloFirestore.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-firebase-firestore-makeUpperCase.yaml b/.github/workflows/functions-v2-firebase-firestore-makeUpperCase.yaml index 469352bf12..f897d7374e 100644 --- a/.github/workflows/functions-v2-firebase-firestore-makeUpperCase.yaml +++ b/.github/workflows/functions-v2-firebase-firestore-makeUpperCase.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/firebase/firestore/makeUpperCase/**' - '.github/workflows/functions-v2-firebase-firestore-makeUpperCase.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/firebase/firestore/makeUpperCase/**' - '.github/workflows/functions-v2-firebase-firestore-makeUpperCase.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/firebase/firestore/makeUpperCase/**' - '.github/workflows/functions-v2-firebase-firestore-makeUpperCase.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-firebase-remote-config-helloRemoteConfig.yaml b/.github/workflows/functions-v2-firebase-remote-config-helloRemoteConfig.yaml index df6ff6b32b..e7c4544e2c 100644 --- a/.github/workflows/functions-v2-firebase-remote-config-helloRemoteConfig.yaml +++ b/.github/workflows/functions-v2-firebase-remote-config-helloRemoteConfig.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/firebase/remote-config/helloRemoteConfig/**' - '.github/workflows/functions-v2-firebase-remote-config-helloRemoteConfig.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/firebase/remote-config/helloRemoteConfig/**' - '.github/workflows/functions-v2-firebase-remote-config-helloRemoteConfig.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/firebase/remote-config/helloRemoteConfig/**' - '.github/workflows/functions-v2-firebase-remote-config-helloRemoteConfig.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-firebase-rtdb-helloRTDB.yaml b/.github/workflows/functions-v2-firebase-rtdb-helloRTDB.yaml index 56f980a9c1..8e9761194e 100644 --- a/.github/workflows/functions-v2-firebase-rtdb-helloRTDB.yaml +++ b/.github/workflows/functions-v2-firebase-rtdb-helloRTDB.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/firebase/rtdb/helloRTDB/**' - '.github/workflows/functions-v2-firebase-rtdb-helloRTDB.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/firebase/rtdb/helloRTDB/**' - '.github/workflows/functions-v2-firebase-rtdb-helloRTDB.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/firebase/rtdb/helloRTDB/**' - '.github/workflows/functions-v2-firebase-rtdb-helloRTDB.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-helloauditlog.yaml b/.github/workflows/functions-v2-helloauditlog.yaml index 94cadac465..d43fc455ca 100644 --- a/.github/workflows/functions-v2-helloauditlog.yaml +++ b/.github/workflows/functions-v2-helloauditlog.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/helloAuditLog/**' - '.github/workflows/functions-v2-helloAuditLog.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/helloAuditLog/**' - '.github/workflows/functions-v2-helloAuditLog.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/helloAuditLog/**' - '.github/workflows/functions-v2-helloAuditLog.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-hellobigquery.yaml b/.github/workflows/functions-v2-hellobigquery.yaml index 02f2f7e03a..002f66294a 100644 --- a/.github/workflows/functions-v2-hellobigquery.yaml +++ b/.github/workflows/functions-v2-hellobigquery.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/helloBigQuery/**' - '.github/workflows/functions-v2-helloBigQuery.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/helloBigQuery/**' - '.github/workflows/functions-v2-helloBigQuery.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/helloBigQuery/**' - '.github/workflows/functions-v2-helloBigQuery.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-hellogcs.yaml b/.github/workflows/functions-v2-hellogcs.yaml index e74e9fdaa4..517a24aad4 100644 --- a/.github/workflows/functions-v2-hellogcs.yaml +++ b/.github/workflows/functions-v2-hellogcs.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/helloGCS/**' - '.github/workflows/functions-v2-helloGCS.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/helloGCS/**' - '.github/workflows/functions-v2-helloGCS.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/helloGCS/**' - '.github/workflows/functions-v2-helloGCS.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-hellopubsub.yaml b/.github/workflows/functions-v2-hellopubsub.yaml index 20c324f7d1..b47cd12027 100644 --- a/.github/workflows/functions-v2-hellopubsub.yaml +++ b/.github/workflows/functions-v2-hellopubsub.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/helloPubSub/**' - '.github/workflows/functions-v2-helloPubSub.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/helloPubSub/**' - '.github/workflows/functions-v2-helloPubSub.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/helloPubSub/**' - '.github/workflows/functions-v2-helloPubSub.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-httplogging.yaml b/.github/workflows/functions-v2-httplogging.yaml index e985baba06..34a55375f9 100644 --- a/.github/workflows/functions-v2-httplogging.yaml +++ b/.github/workflows/functions-v2-httplogging.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/httpLogging/**' - '.github/workflows/functions-v2-httpLogging.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/httpLogging/**' - '.github/workflows/functions-v2-httpLogging.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/httpLogging/**' - '.github/workflows/functions-v2-httpLogging.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-log-processEntry.yaml b/.github/workflows/functions-v2-log-processEntry.yaml index 17ef245ad5..34fe926dae 100644 --- a/.github/workflows/functions-v2-log-processEntry.yaml +++ b/.github/workflows/functions-v2-log-processEntry.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/log/processEntry/**' - '.github/workflows/functions-v2-log-processEntry.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/log/processEntry/**' - '.github/workflows/functions-v2-log-processEntry.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/log/processEntry/**' - '.github/workflows/functions-v2-log-processEntry.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-ocr-app.yaml b/.github/workflows/functions-v2-ocr-app.yaml index b23def5af2..c50d6da923 100644 --- a/.github/workflows/functions-v2-ocr-app.yaml +++ b/.github/workflows/functions-v2-ocr-app.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/ocr/app/**' - '.github/workflows/functions-v2-ocr-app.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/ocr/app/**' - '.github/workflows/functions-v2-ocr-app.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/ocr/app/**' - '.github/workflows/functions-v2-ocr-app.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-tips-avoidInfiniteRetries.yaml b/.github/workflows/functions-v2-tips-avoidInfiniteRetries.yaml index 4093895d5f..b207097ca9 100644 --- a/.github/workflows/functions-v2-tips-avoidInfiniteRetries.yaml +++ b/.github/workflows/functions-v2-tips-avoidInfiniteRetries.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/tips/avoidInfiniteRetries/**' - '.github/workflows/functions-v2-tips-avoidInfiniteRetries.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/tips/avoidInfiniteRetries/**' - '.github/workflows/functions-v2-tips-avoidInfiniteRetries.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/tips/avoidInfiniteRetries/**' - '.github/workflows/functions-v2-tips-avoidInfiniteRetries.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-tips-retry.yaml b/.github/workflows/functions-v2-tips-retry.yaml index a1e28b7998..ac6d674b09 100644 --- a/.github/workflows/functions-v2-tips-retry.yaml +++ b/.github/workflows/functions-v2-tips-retry.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/tips/retry/**' - '.github/workflows/functions-v2-tips-retry.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/tips/retry/**' - '.github/workflows/functions-v2-tips-retry.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/tips/retry/**' - '.github/workflows/functions-v2-tips-retry.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-typed-googlechatbot.yaml b/.github/workflows/functions-v2-typed-googlechatbot.yaml index 1baa0b01f1..39f2febe98 100644 --- a/.github/workflows/functions-v2-typed-googlechatbot.yaml +++ b/.github/workflows/functions-v2-typed-googlechatbot.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/typed/googlechatbot/**' - '.github/workflows/functions-v2-typed-googlechatbot.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/typed/googlechatbot/**' - '.github/workflows/functions-v2-typed-googlechatbot.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/typed/googlechatbot/**' - '.github/workflows/functions-v2-typed-googlechatbot.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/functions-v2-typed-greeting.yaml b/.github/workflows/functions-v2-typed-greeting.yaml index 6b7bad98e1..be6a244ae8 100644 --- a/.github/workflows/functions-v2-typed-greeting.yaml +++ b/.github/workflows/functions-v2-typed-greeting.yaml @@ -20,15 +20,18 @@ on: paths: - 'functions/v2/typed/greeting/**' - '.github/workflows/functions-v2-typed-greeting.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'functions/v2/typed/greeting/**' - '.github/workflows/functions-v2-typed-greeting.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'functions/v2/typed/greeting/**' - '.github/workflows/functions-v2-typed-greeting.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/game-servers-snippets.yaml b/.github/workflows/game-servers-snippets.yaml index e0a5f0904b..519a1eb467 100644 --- a/.github/workflows/game-servers-snippets.yaml +++ b/.github/workflows/game-servers-snippets.yaml @@ -20,15 +20,18 @@ on: paths: - 'game-servers/snippets/**' - '.github/workflows/game-servers-snippets.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'game-servers/snippets/**' - '.github/workflows/game-servers-snippets.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'game-servers/snippets/**' - '.github/workflows/game-servers-snippets.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/healthcare-consent.yaml b/.github/workflows/healthcare-consent.yaml index b03bde9369..3115f38aba 100644 --- a/.github/workflows/healthcare-consent.yaml +++ b/.github/workflows/healthcare-consent.yaml @@ -20,15 +20,18 @@ on: paths: - 'healthcare/consent/**' - '.github/workflows/healthcare-consent.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'healthcare/consent/**' - '.github/workflows/healthcare-consent.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'healthcare/consent/**' - '.github/workflows/healthcare-consent.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/healthcare-datasets.yaml b/.github/workflows/healthcare-datasets.yaml index dd7ae85d08..04fd9a6571 100644 --- a/.github/workflows/healthcare-datasets.yaml +++ b/.github/workflows/healthcare-datasets.yaml @@ -20,15 +20,18 @@ on: paths: - 'healthcare/datasets/**' - '.github/workflows/healthcare-datasets.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'healthcare/datasets/**' - '.github/workflows/healthcare-datasets.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'healthcare/datasets/**' - '.github/workflows/healthcare-datasets.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/healthcare-dicom.yaml b/.github/workflows/healthcare-dicom.yaml index 780b45c1c8..bed46d63ec 100644 --- a/.github/workflows/healthcare-dicom.yaml +++ b/.github/workflows/healthcare-dicom.yaml @@ -20,15 +20,18 @@ on: paths: - 'healthcare/dicom/**' - '.github/workflows/healthcare-dicom.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'healthcare/dicom/**' - '.github/workflows/healthcare-dicom.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'healthcare/dicom/**' - '.github/workflows/healthcare-dicom.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/healthcare-fhir.yaml b/.github/workflows/healthcare-fhir.yaml index d461ac41b8..c03d9905b3 100644 --- a/.github/workflows/healthcare-fhir.yaml +++ b/.github/workflows/healthcare-fhir.yaml @@ -20,15 +20,18 @@ on: paths: - 'healthcare/fhir/**' - '.github/workflows/healthcare-fhir.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'healthcare/fhir/**' - '.github/workflows/healthcare-fhir.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'healthcare/fhir/**' - '.github/workflows/healthcare-fhir.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/healthcare-hl7v2.yaml b/.github/workflows/healthcare-hl7v2.yaml index fd319a091b..9bf7bedbae 100644 --- a/.github/workflows/healthcare-hl7v2.yaml +++ b/.github/workflows/healthcare-hl7v2.yaml @@ -20,15 +20,18 @@ on: paths: - 'healthcare/hl7v2/**' - '.github/workflows/healthcare-hl7v2.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'healthcare/hl7v2/**' - '.github/workflows/healthcare-hl7v2.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'healthcare/hl7v2/**' - '.github/workflows/healthcare-hl7v2.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/kms.yaml b/.github/workflows/kms.yaml index b2509ab7a4..07168d8f71 100644 --- a/.github/workflows/kms.yaml +++ b/.github/workflows/kms.yaml @@ -20,15 +20,18 @@ on: paths: - 'kms/**' - '.github/workflows/kms.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'kms/**' - '.github/workflows/kms.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'kms/**' - '.github/workflows/kms.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/media-livestream.yaml b/.github/workflows/media-livestream.yaml index 3c9b04addd..718d5285f0 100644 --- a/.github/workflows/media-livestream.yaml +++ b/.github/workflows/media-livestream.yaml @@ -20,15 +20,18 @@ on: paths: - 'media/livestream/**' - '.github/workflows/media-livestream.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'media/livestream/**' - '.github/workflows/media-livestream.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'media/livestream/**' - '.github/workflows/media-livestream.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/media-transcoder.yaml b/.github/workflows/media-transcoder.yaml index d871392f34..dfa7c315c9 100644 --- a/.github/workflows/media-transcoder.yaml +++ b/.github/workflows/media-transcoder.yaml @@ -20,15 +20,18 @@ on: paths: - 'media/transcoder/**' - '.github/workflows/media-transcoder.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'media/transcoder/**' - '.github/workflows/media-transcoder.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'media/transcoder/**' - '.github/workflows/media-transcoder.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/media-video-stitcher.yaml b/.github/workflows/media-video-stitcher.yaml index 8369d91467..4f8dbcd022 100644 --- a/.github/workflows/media-video-stitcher.yaml +++ b/.github/workflows/media-video-stitcher.yaml @@ -20,15 +20,18 @@ on: paths: - 'media/video-stitcher/**' - '.github/workflows/media-video-stitcher.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'media/video-stitcher/**' - '.github/workflows/media-video-stitcher.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'media/video-stitcher/**' - '.github/workflows/media-video-stitcher.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/mediatranslation.yaml b/.github/workflows/mediatranslation.yaml index b08b8bbc41..c8d896f518 100644 --- a/.github/workflows/mediatranslation.yaml +++ b/.github/workflows/mediatranslation.yaml @@ -20,15 +20,18 @@ on: paths: - 'mediatranslation/**' - '.github/workflows/mediatranslation.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'mediatranslation/**' - '.github/workflows/mediatranslation.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'mediatranslation/**' - '.github/workflows/mediatranslation.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/monitoring-opencensus.yaml b/.github/workflows/monitoring-opencensus.yaml index 04ee2a31c0..d0cdf5826e 100644 --- a/.github/workflows/monitoring-opencensus.yaml +++ b/.github/workflows/monitoring-opencensus.yaml @@ -20,15 +20,18 @@ on: paths: - 'monitoring/opencensus/**' - '.github/workflows/monitoring-opencensus.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'monitoring/opencensus/**' - '.github/workflows/monitoring-opencensus.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'monitoring/opencensus/**' - '.github/workflows/monitoring-opencensus.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/monitoring-prometheus.yaml b/.github/workflows/monitoring-prometheus.yaml index 42d681b654..82eb5e4422 100644 --- a/.github/workflows/monitoring-prometheus.yaml +++ b/.github/workflows/monitoring-prometheus.yaml @@ -20,15 +20,18 @@ on: paths: - 'monitoring/prometheus/**' - '.github/workflows/monitoring-prometheus.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'monitoring/prometheus/**' - '.github/workflows/monitoring-prometheus.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'monitoring/prometheus/**' - '.github/workflows/monitoring-prometheus.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/monitoring-snippets.yaml b/.github/workflows/monitoring-snippets.yaml index b07d5a14d3..9a5e97c009 100644 --- a/.github/workflows/monitoring-snippets.yaml +++ b/.github/workflows/monitoring-snippets.yaml @@ -20,15 +20,18 @@ on: paths: - 'monitoring/snippets/**' - '.github/workflows/monitoring-snippets.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'monitoring/snippets/**' - '.github/workflows/monitoring-snippets.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'monitoring/snippets/**' - '.github/workflows/monitoring-snippets.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/opencensus.yaml b/.github/workflows/opencensus.yaml index e30689a476..a58abf8c42 100644 --- a/.github/workflows/opencensus.yaml +++ b/.github/workflows/opencensus.yaml @@ -20,15 +20,18 @@ on: paths: - 'opencensus/**' - '.github/workflows/opencensus.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'opencensus/**' - '.github/workflows/opencensus.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'opencensus/**' - '.github/workflows/opencensus.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/recaptcha-enterprise.yaml b/.github/workflows/recaptcha-enterprise.yaml index eab5ccb5a3..4abec2488c 100644 --- a/.github/workflows/recaptcha-enterprise.yaml +++ b/.github/workflows/recaptcha-enterprise.yaml @@ -20,15 +20,18 @@ on: paths: - 'recaptcha_enterprise/snippets/**' - '.github/workflows/recaptcha-enterprise.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'recaptcha_enterprise/snippets/**' - '.github/workflows/recaptcha-enterprise.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'recaptcha_enterprise/snippets/**' - '.github/workflows/recaptcha-enterprise.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/retail.yaml b/.github/workflows/retail.yaml index 2b30d32581..039e1fac87 100644 --- a/.github/workflows/retail.yaml +++ b/.github/workflows/retail.yaml @@ -20,15 +20,18 @@ on: paths: - 'retail/**' - '.github/workflows/retail.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'retail/**' - '.github/workflows/retail.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'retail/**' - '.github/workflows/retail.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/run-filesystem.yaml b/.github/workflows/run-filesystem.yaml index 985c44b711..2c7042a369 100644 --- a/.github/workflows/run-filesystem.yaml +++ b/.github/workflows/run-filesystem.yaml @@ -20,15 +20,18 @@ on: paths: - 'run/filesystem/**' - '.github/workflows/run-filesystem.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'run/filesystem/**' - '.github/workflows/run-filesystem.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'run/filesystem/**' - '.github/workflows/run-filesystem.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/scheduler.yaml b/.github/workflows/scheduler.yaml index 5ecb00d05e..6e4d93d471 100644 --- a/.github/workflows/scheduler.yaml +++ b/.github/workflows/scheduler.yaml @@ -20,15 +20,18 @@ on: paths: - 'scheduler/**' - '.github/workflows/scheduler.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'scheduler/**' - '.github/workflows/scheduler.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'scheduler/**' - '.github/workflows/scheduler.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/secret-manager.yaml b/.github/workflows/secret-manager.yaml index ae773c6f73..2496b665bf 100644 --- a/.github/workflows/secret-manager.yaml +++ b/.github/workflows/secret-manager.yaml @@ -20,15 +20,18 @@ on: paths: - 'secret-manager/**' - '.github/workflows/secret-manager.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'secret-manager/**' - '.github/workflows/secret-manager.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'secret-manager/**' - '.github/workflows/secret-manager.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/service-directory-snippets.yaml b/.github/workflows/service-directory-snippets.yaml index 8b2cb6d7b2..5afdd8530d 100644 --- a/.github/workflows/service-directory-snippets.yaml +++ b/.github/workflows/service-directory-snippets.yaml @@ -20,15 +20,18 @@ on: paths: - 'service-directory/snippets/**' - '.github/workflows/service-directory-snippets.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'service-directory/snippets/**' - '.github/workflows/service-directory-snippets.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'service-directory/snippets/**' - '.github/workflows/service-directory-snippets.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/speech.yaml b/.github/workflows/speech.yaml index 9fb4c2a386..e3ab8cb4c1 100644 --- a/.github/workflows/speech.yaml +++ b/.github/workflows/speech.yaml @@ -20,15 +20,18 @@ on: paths: - 'speech/**' - '.github/workflows/speech.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'speech/**' - '.github/workflows/speech.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'speech/**' - '.github/workflows/speech.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/talent.yaml b/.github/workflows/talent.yaml index a0f94588bf..6211caf4e8 100644 --- a/.github/workflows/talent.yaml +++ b/.github/workflows/talent.yaml @@ -20,15 +20,18 @@ on: paths: - 'talent/**' - '.github/workflows/talent.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'talent/**' - '.github/workflows/talent.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'talent/**' - '.github/workflows/talent.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 006567b990..44eeee1646 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,10 +17,10 @@ name: Test Sample on: workflow_call: inputs: - name: + name: required: true type: string - path: + path: required: true type: string jobs: @@ -30,9 +30,6 @@ jobs: permissions: contents: 'read' id-token: 'write' - defaults: - run: - working-directory: ${{ inputs.path }} steps: - uses: actions/checkout@v4.1.0 with: @@ -49,20 +46,14 @@ jobs: - name: Get npm cache directory id: npm-cache-dir shell: bash - run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} + run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} - uses: actions/cache@v3 id: npm-cache with: path: ${{ steps.npm-cache-dir.outputs.dir }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | - ${{ runner.os }}-node- - - name: install repo dependencies - run: npm install - working-directory: . - - name: install directory dependencies - run: npm install - - run: npm run build --if-present + ${{ runner.os }}-node- - name: set testing env vars run: echo "MOCHA_REPORTER_OUTPUT=${{github.run_id}}_sponge_log.xml" >> $GITHUB_ENV - name: set testing env vars for scheduled run @@ -70,7 +61,10 @@ jobs: run: | echo "MOCHA_REPORTER_SUITENAME=${{ inputs.name }}" >> $GITHUB_ENV echo "MOCHA_REPORTER=xunit" >> $GITHUB_ENV - - run: npm test + - name: Run Tests + run: make test dir=${{ inputs.path }} + env: + GOOGLE_SAMPLES_PROJECT: "long-door-651" - name: upload test results for FlakyBot workflow if: github.event.action == 'schedule' && always() uses: actions/upload-artifact@v3 diff --git a/.github/workflows/texttospeech.yaml b/.github/workflows/texttospeech.yaml index 0f64f77ec3..6573c4df2e 100644 --- a/.github/workflows/texttospeech.yaml +++ b/.github/workflows/texttospeech.yaml @@ -20,15 +20,18 @@ on: paths: - 'texttospeech/**' - '.github/workflows/texttospeech.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'texttospeech/**' - '.github/workflows/texttospeech.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'texttospeech/**' - '.github/workflows/texttospeech.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/translate.yaml b/.github/workflows/translate.yaml index 2f618e6578..3fe8abd0b4 100644 --- a/.github/workflows/translate.yaml +++ b/.github/workflows/translate.yaml @@ -20,15 +20,18 @@ on: paths: - 'translate/**' - '.github/workflows/translate.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'translate/**' - '.github/workflows/translate.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'translate/**' - '.github/workflows/translate.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/utils/ci-secrets.yaml.njk b/.github/workflows/utils/ci-secrets.yaml.njk index 9cd0730339..730b02968e 100644 --- a/.github/workflows/utils/ci-secrets.yaml.njk +++ b/.github/workflows/utils/ci-secrets.yaml.njk @@ -39,9 +39,6 @@ jobs: permissions: contents: 'read' id-token: 'write' - defaults: - run: - working-directory: '{{ path }}' steps: - uses: actions/checkout@v4.1.0 with: @@ -65,7 +62,7 @@ jobs: - name: Get npm cache directory id: npm-cache-dir shell: bash - run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} + run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} - uses: actions/cache@v3 id: npm-cache with: @@ -73,20 +70,16 @@ jobs: key: ${% raw %}{{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}{% endraw %} restore-keys: | ${% raw %}{{ runner.os }}-node-{% endraw %} - - name: install repo dependencies - run: npm install - working-directory: . - - name: install directory dependencies - run: npm install - - run: npm run build --if-present - name: set env vars for scheduled run if: github.event.action == 'schedule' run: | echo "MOCHA_REPORTER_SUITENAME={{ name }}" >> $GITHUB_ENV echo "MOCHA_REPORTER_OUTPUT=${% raw %}{{github.run_id}}{% endraw %}_sponge_log.xml" >> $GITHUB_ENV echo "MOCHA_REPORTER=xunit" >> $GITHUB_ENV - - run: npm test + - name: Run Tests + run: make test dir={{ path }} env: + GOOGLE_SAMPLES_PROJECT: "long-door-651" # TODO: Update environment variables SECRET_1: ${% raw %}{{ steps.secrets.outputs.secret_key_1 }}{% endraw %} SECRET_2: ${% raw %}{{ steps.secrets.outputs.secret_key_2 }}{% endraw %} @@ -98,7 +91,7 @@ jobs: with: name: test-results path: {{ path }}/${% raw %}{{ env.MOCHA_REPORTER_OUTPUT }}{% endraw %} - retention-days: 1 + retention-days: 1 flakybot: permissions: contents: 'read' diff --git a/.github/workflows/video-intelligence.yaml b/.github/workflows/video-intelligence.yaml index d165e88b8d..7e68ab420a 100644 --- a/.github/workflows/video-intelligence.yaml +++ b/.github/workflows/video-intelligence.yaml @@ -20,15 +20,18 @@ on: paths: - 'video-intelligence/**' - '.github/workflows/video-intelligence.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'video-intelligence/**' - '.github/workflows/video-intelligence.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'video-intelligence/**' - '.github/workflows/video-intelligence.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/vision-productSearch.yaml b/.github/workflows/vision-productSearch.yaml index c7aa25ddce..dafca138f4 100644 --- a/.github/workflows/vision-productSearch.yaml +++ b/.github/workflows/vision-productSearch.yaml @@ -20,15 +20,18 @@ on: paths: - 'vision/productSearch/**' - '.github/workflows/vision-productSearch.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'vision/productSearch/**' - '.github/workflows/vision-productSearch.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'vision/productSearch/**' - '.github/workflows/vision-productSearch.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/.github/workflows/workflows.yaml b/.github/workflows/workflows.yaml index 6edb45fcb3..60c2a620dd 100644 --- a/.github/workflows/workflows.yaml +++ b/.github/workflows/workflows.yaml @@ -20,15 +20,18 @@ on: paths: - 'workflows/**' - '.github/workflows/workflows.yaml' + - '.github/workflows/test.yaml' pull_request: paths: - 'workflows/**' - '.github/workflows/workflows.yaml' + - '.github/workflows/test.yaml' pull_request_target: types: [labeled] paths: - 'workflows/**' - '.github/workflows/workflows.yaml' + - '.github/workflows/test.yaml' schedule: - cron: '0 0 * * 0' jobs: diff --git a/Makefile b/Makefile index ad35aa391f..bb15fcb493 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ dir ?= $(shell pwd) export GOOGLE_CLOUD_PROJECT = ${GOOGLE_SAMPLES_PROJECT} build: + npm install cd ${dir} npm install npm run build --if-present diff --git a/ai-platform/snippets/package.json b/ai-platform/snippets/package.json index e2d0e6c631..2de402a81b 100644 --- a/ai-platform/snippets/package.json +++ b/ai-platform/snippets/package.json @@ -25,3 +25,4 @@ "sinon": "^16.0.0" } } + diff --git a/document-warehouse/package.json b/document-warehouse/package.json index e5a9e1ea84..ee29c3c089 100644 --- a/document-warehouse/package.json +++ b/document-warehouse/package.json @@ -12,6 +12,7 @@ "@google-cloud/resource-manager": "^5.0.0" }, "devDependencies": { - "assert": "^2.0.0" + "assert": "^2.0.0", + "c8": "^8.0.1" } } diff --git a/functions/env_vars/package.json b/functions/env_vars/package.json index 80e45a4c0c..19fb3875c9 100644 --- a/functions/env_vars/package.json +++ b/functions/env_vars/package.json @@ -15,6 +15,7 @@ "test": "c8 mocha -p -j 2 test/*.test.js --timeout=20000" }, "devDependencies": { + "c8": "^8.0.1", "mocha": "^10.0.0", "sinon": "^16.0.0" }