@@ -47,140 +47,3 @@ jobs:
4747 env :
4848 BUILD_TYPE : continuous
4949 TEST_TYPE : lint
50- generator-test :
51- runs-on : ubuntu-latest
52- container : gcr.io/gapic-images/googleapis:20250404
53- # Dockerfile for this image: https://github.com/googleapis/googleapis-discovery/blob/master/Dockerfile
54- # If you update its version, please also update it below in
55- # 'Cache Bazel files' - unfortunately it cannot accept variables at this
56- # time.
57-
58- steps :
59- - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
60- with :
61- fetch-depth : 300
62-
63- - name : Get changed files
64- id : changed-files
65- uses : tj-actions/changed-files@v44
66- with :
67- files : generator/**
68-
69- - name : Cache Bazel files
70- if : steps.changed-files.outputs.any_changed == 'true'
71- id : cache-bazel
72- uses : actions/cache@v4
73- with :
74- path : ~/.cache/bazel
75- key : ${{ runner.os }}-googleapis-20250422-${{ secrets.CACHE_VERSION }}
76-
77- - name : Setup Node.js
78- if : steps.changed-files.outputs.any_changed == 'true'
79- uses : actions/setup-node@v6
80- with :
81- node-version : 18.x
82-
83- - name : Install Node dependencies with npm
84- if : steps.changed-files.outputs.any_changed == 'true'
85- run : npm install
86-
87- - name : Run bazel build
88- if : steps.changed-files.outputs.any_changed == 'true'
89- working-directory : ./generator/gapic-generator-typescript
90- run : bazelisk build --noremote_accept_cached '//...'
91-
92- - name : Run bazel test
93- if : steps.changed-files.outputs.any_changed == 'true'
94- working-directory : ./generator/gapic-generator-typescript
95- run : bazelisk test --test_output=errors --noremote_accept_cached //...
96-
97- - name : Verify error conformance
98- if : steps.changed-files.outputs.any_changed == 'true'
99- working-directory : ./generator/gapic-generator-typescript
100- run : |
101- curl -sSL https://github.com/googleapis/gapic-config-validator/releases/download/v0.6.0/gapic-config-validator-0.6.0-linux-amd64.tar.gz > config-validator.tar.gz
102- tar xzf config-validator.tar.gz --no-same-owner
103- chmod +x gapic-error-conformance
104- chmod +x bazel-bin/protoc_plugin_/protoc_plugin
105- ./gapic-error-conformance -plugin="bazel-bin/protoc_plugin_/protoc_plugin"
106-
107- - name : Prepare baseline artifacts
108- if : steps.changed-files.outputs.any_changed == 'true'
109- working-directory : ./generator/gapic-generator-typescript
110- run : |
111- mkdir -p ~/artifacts
112- cp bazel-testlogs/unit_tests/test.outputs/outputs.zip ~/artifacts/
113- bazelisk run -- @pnpm//:pnpm --dir $PWD install
114- tar cfz ~/artifacts/node_modules.tar.gz node_modules
115-
116- - name : Save artifacts
117- if : steps.changed-files.outputs.any_changed == 'true'
118- uses : actions/upload-artifact@v5
119- with :
120- name : artifacts
121- path : ~/artifacts
122-
123- - name : Test generated libraries
124- if : steps.changed-files.outputs.any_changed == 'true'
125- run : |
126- set -ex
127- unzip ~/artifacts/outputs.zip -d library
128- for lib in showcase kms translate monitoring dlp texttospeech showcase-legacy compute logging bigquery-v2 redis retail; do
129- echo "--- Testing library $lib ---"
130- cd library/.test-out-$lib
131- npm install
132- npm test
133- npm run fix
134- rm -rf build
135- npm run compile
136- npm run system-test
137- npm run docs
138- cd ../..
139- done
140-
141- - name : Test generated ESM libraries
142- if : steps.changed-files.outputs.any_changed == 'true'
143- run : |
144- set -ex
145- for lib in showcase kms translate monitoring dlp texttospeech showcase-legacy compute logging bigquery-v2 redis retail; do
146- echo "--- Testing ESM library $lib ---"
147- cd library/.test-out-$lib-esm
148- npm install
149- npm test
150- npm run fix
151- rm -rf build
152- npm run compile
153- npm run system-test
154- cd ../..
155- done
156-
157- - name : Test combined library (Speech)
158- if : steps.changed-files.outputs.any_changed == 'true'
159- env :
160- TEST_ENV_DESTINATION_PATH : generator/gapic-generator-typescript/test-fixtures/google-cloud-speech
161- run : generator/gapic-generator-typescript/rules_typescript_gapic/combine_script.sh generator/gapic-generator-typescript/test-fixtures/google-cloud-speech-nodejs v1 "" "" generator/gapic-generator-typescript/node_modules/gapic-tools/build/src/compileProtos.js generator/gapic-generator-typescript/node_modules/gapic-node-processing/build/src/cli.js ""
162-
163- - name : Run tests for combined library (Speech)
164- if : steps.changed-files.outputs.any_changed == 'true'
165- run : |
166- set -ex
167- cd generator/gapic-generator-typescript/test-fixtures/google-cloud-speech
168- npm install
169- npm test
170- npm run system-test
171-
172- - name : Test combined library (Tasks)
173- if : steps.changed-files.outputs.any_changed == 'true'
174- env :
175- TEST_ENV_DESTINATION_PATH : generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks
176- run : generator/gapic-generator-typescript/rules_typescript_gapic/combine_script.sh generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs v2 "" "" generator/gapic-generator-typescript/node_modules/gapic-tools/build/src/compileProtos.js generator/gapic-generator-typescript/node_modules/gapic-node-processing/build/src/cli.js ""
177-
178- - name : Run tests for combined library (Tasks)
179- if : steps.changed-files.outputs.any_changed == 'true'
180- run : |
181- set -ex
182- cd generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks
183- npm install
184- npm test
185- npm run system-test
186-
0 commit comments