Skip to content

Commit 90f4395

Browse files
Merge branch 'google-cloud-node-core-migration'
2 parents 06e91b6 + 799df61 commit 90f4395

File tree

3,973 files changed

+1612376
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,973 files changed

+1612376
-7
lines changed

.github/workflows/continuous.yaml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,150 @@ jobs:
2020
env:
2121
BUILD_TYPE: continuous
2222
TEST_TYPE: units
23+
generator-test:
24+
runs-on: ubuntu-latest
25+
container: gcr.io/gapic-images/googleapis:20250404
26+
# Dockerfile for this image: https://github.com/googleapis/googleapis-discovery/blob/master/Dockerfile
27+
# If you update its version, please also update it below in
28+
# 'Cache Bazel files' - unfortunately it cannot accept variables at this
29+
# time.
30+
31+
steps:
32+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
33+
with:
34+
fetch-depth: 0 # Fetch all history for comparison on push events
35+
36+
- name: Mark repo as safe for git
37+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
38+
39+
- name: Check for changes in generator
40+
id: generator-changes
41+
run: |
42+
if [ "${{ github.event_name }}" = "pull_request" ]; then
43+
git fetch origin ${{ github.base_ref }} --depth=1
44+
if git diff --name-only origin/${{ github.base_ref }}...${{ github.sha }} | grep -q "^generator/"; then
45+
echo "changes=true" >> $GITHUB_OUTPUT
46+
fi
47+
else
48+
if git diff --name-only HEAD~1 HEAD | grep -q "^generator/"; then
49+
echo "changes=true" >> $GITHUB_OUTPUT
50+
fi
51+
fi
52+
53+
- name: Cache Bazel files
54+
if: steps.generator-changes.outputs.changes == 'true'
55+
id: cache-bazel
56+
uses: actions/cache@v4
57+
with:
58+
path: ~/.cache/bazel
59+
key: ${{ runner.os }}-googleapis-20250422-${{ secrets.CACHE_VERSION }}
60+
61+
- name: Setup Node.js
62+
if: steps.generator-changes.outputs.changes == 'true'
63+
uses: actions/setup-node@v6
64+
with:
65+
node-version: 18.x
66+
67+
- name: Install Node dependencies with npm
68+
if: steps.generator-changes.outputs.changes == 'true'
69+
run: npm install
70+
71+
- name: Run bazel build
72+
if: steps.generator-changes.outputs.changes == 'true'
73+
working-directory: ./generator/gapic-generator-typescript
74+
run: bazelisk build --noremote_accept_cached '//...'
75+
76+
- name: Run bazel test
77+
if: steps.generator-changes.outputs.changes == 'true'
78+
working-directory: ./generator/gapic-generator-typescript
79+
run: bazelisk test --test_output=errors --noremote_accept_cached //...
80+
81+
- name: Verify error conformance
82+
if: steps.generator-changes.outputs.changes == 'true'
83+
working-directory: ./generator/gapic-generator-typescript
84+
run: |
85+
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
86+
tar xzf config-validator.tar.gz --no-same-owner
87+
chmod +x gapic-error-conformance
88+
chmod +x bazel-bin/protoc_plugin_/protoc_plugin
89+
./gapic-error-conformance -plugin="bazel-bin/protoc_plugin_/protoc_plugin"
90+
91+
- name: Prepare baseline artifacts
92+
if: steps.generator-changes.outputs.changes == 'true'
93+
working-directory: ./generator/gapic-generator-typescript
94+
run: |
95+
mkdir -p ~/artifacts
96+
cp bazel-testlogs/unit_tests/test.outputs/outputs.zip ~/artifacts/
97+
bazelisk run -- @pnpm//:pnpm --dir $PWD install
98+
tar cfz ~/artifacts/node_modules.tar.gz node_modules
99+
100+
- name: Save artifacts
101+
if: steps.generator-changes.outputs.changes == 'true'
102+
uses: actions/upload-artifact@v5
103+
with:
104+
name: artifacts
105+
path: ~/artifacts
106+
107+
- name: Test generated libraries
108+
if: steps.generator-changes.outputs.changes == 'true'
109+
run: |
110+
set -ex
111+
unzip ~/artifacts/outputs.zip -d library
112+
for lib in showcase kms translate monitoring dlp texttospeech showcase-legacy compute logging bigquery-v2 redis retail; do
113+
echo "--- Testing library $lib ---"
114+
cd library/.test-out-$lib
115+
npm install
116+
npm test
117+
npm run fix
118+
rm -rf build
119+
npm run compile
120+
npm run system-test
121+
npm run docs
122+
cd ../..
123+
done
124+
125+
- name: Test generated ESM libraries
126+
if: steps.generator-changes.outputs.changes == 'true'
127+
run: |
128+
set -ex
129+
for lib in showcase kms translate monitoring dlp texttospeech showcase-legacy compute logging bigquery-v2 redis retail; do
130+
echo "--- Testing ESM library $lib ---"
131+
cd library/.test-out-$lib-esm
132+
npm install
133+
npm test
134+
npm run fix
135+
rm -rf build
136+
npm run compile
137+
npm run system-test
138+
cd ../..
139+
done
140+
141+
- name: Test combined library (Speech)
142+
if: steps.generator-changes.outputs.changes == 'true'
143+
env:
144+
TEST_ENV_DESTINATION_PATH: generator/gapic-generator-typescript/test-fixtures/google-cloud-speech
145+
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 ""
146+
147+
- name: Run tests for combined library (Speech)
148+
if: steps.generator-changes.outputs.changes == 'true'
149+
run: |
150+
set -ex
151+
cd generator/gapic-generator-typescript/test-fixtures/google-cloud-speech
152+
npm install
153+
npm test
154+
npm run system-test
155+
156+
- name: Test combined library (Tasks)
157+
if: steps.generator-changes.outputs.changes == 'true'
158+
env:
159+
TEST_ENV_DESTINATION_PATH: generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks
160+
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 ""
161+
162+
- name: Run tests for combined library (Tasks)
163+
if: steps.generator-changes.outputs.changes == 'true'
164+
run: |
165+
set -ex
166+
cd generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks
167+
npm install
168+
npm test
169+
npm run system-test

.github/workflows/presubmit.yaml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,151 @@ jobs:
2424
env:
2525
BUILD_TYPE: presubmit
2626
TEST_TYPE: units
27+
generator-test:
28+
runs-on: ubuntu-latest
29+
container: gcr.io/gapic-images/googleapis:20250404
30+
# Dockerfile for this image: https://github.com/googleapis/googleapis-discovery/blob/master/Dockerfile
31+
# If you update its version, please also update it below in
32+
# 'Cache Bazel files' - unfortunately it cannot accept variables at this
33+
# time.
34+
35+
steps:
36+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
37+
with:
38+
fetch-depth: 300
39+
40+
- name: Mark repo as safe for git
41+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
42+
43+
- name: Check for changes in generator
44+
id: generator-changes
45+
run: |
46+
if [ "${{ github.event_name }}" = "pull_request" ]; then
47+
git fetch origin ${{ github.base_ref }} --depth=1
48+
if git diff --name-only origin/${{ github.base_ref }}...${{ github.sha }} | grep -q "^generator/"; then
49+
echo "changes=true" >> $GITHUB_OUTPUT
50+
fi
51+
else
52+
# for push events, we only have the most recent commit.
53+
if git diff --name-only HEAD~1 HEAD | grep -q "^generator/"; then
54+
echo "changes=true" >> $GITHUB_OUTPUT
55+
fi
56+
fi
57+
58+
- name: Cache Bazel files
59+
if: steps.generator-changes.outputs.changes == 'true'
60+
id: cache-bazel
61+
uses: actions/cache@v4
62+
with:
63+
path: ~/.cache/bazel
64+
key: ${{ runner.os }}-googleapis-20250422-${{ secrets.CACHE_VERSION }}
65+
66+
- name: Setup Node.js
67+
if: steps.generator-changes.outputs.changes == 'true'
68+
uses: actions/setup-node@v6
69+
with:
70+
node-version: 18.x
71+
72+
- name: Install Node dependencies with npm
73+
if: steps.generator-changes.outputs.changes == 'true'
74+
run: npm install
75+
76+
- name: Run bazel build
77+
if: steps.generator-changes.outputs.changes == 'true'
78+
working-directory: ./generator/gapic-generator-typescript
79+
run: bazelisk build --noremote_accept_cached '//...'
80+
81+
- name: Run bazel test
82+
if: steps.generator-changes.outputs.changes == 'true'
83+
working-directory: ./generator/gapic-generator-typescript
84+
run: bazelisk test --test_output=errors --noremote_accept_cached //...
85+
86+
- name: Verify error conformance
87+
if: steps.generator-changes.outputs.changes == 'true'
88+
working-directory: ./generator/gapic-generator-typescript
89+
run: |
90+
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
91+
tar xzf config-validator.tar.gz --no-same-owner
92+
chmod +x gapic-error-conformance
93+
chmod +x bazel-bin/protoc_plugin_/protoc_plugin
94+
./gapic-error-conformance -plugin="bazel-bin/protoc_plugin_/protoc_plugin"
95+
96+
- name: Prepare baseline artifacts
97+
if: steps.generator-changes.outputs.changes == 'true'
98+
working-directory: ./generator/gapic-generator-typescript
99+
run: |
100+
mkdir -p ~/artifacts
101+
cp bazel-testlogs/unit_tests/test.outputs/outputs.zip ~/artifacts/
102+
bazelisk run -- @pnpm//:pnpm --dir $PWD install
103+
tar cfz ~/artifacts/node_modules.tar.gz node_modules
104+
105+
- name: Save artifacts
106+
if: steps.generator-changes.outputs.changes == 'true'
107+
uses: actions/upload-artifact@v5
108+
with:
109+
name: artifacts
110+
path: ~/artifacts
111+
112+
- name: Test generated libraries
113+
if: steps.generator-changes.outputs.changes == 'true'
114+
run: |
115+
set -ex
116+
unzip ~/artifacts/outputs.zip -d library
117+
for lib in showcase kms translate monitoring dlp texttospeech showcase-legacy compute logging bigquery-v2 redis retail; do
118+
echo "--- Testing library $lib ---"
119+
cd library/.test-out-$lib
120+
npm install
121+
npm test
122+
npm run fix
123+
rm -rf build
124+
npm run compile
125+
npm run system-test
126+
npm run docs
127+
cd ../..
128+
done
129+
130+
- name: Test generated ESM libraries
131+
if: steps.generator-changes.outputs.changes == 'true'
132+
run: |
133+
set -ex
134+
for lib in showcase kms translate monitoring dlp texttospeech showcase-legacy compute logging bigquery-v2 redis retail; do
135+
echo "--- Testing ESM library $lib ---"
136+
cd library/.test-out-$lib-esm
137+
npm install
138+
npm test
139+
npm run fix
140+
rm -rf build
141+
npm run compile
142+
npm run system-test
143+
cd ../..
144+
done
145+
146+
- name: Test combined library (Speech)
147+
if: steps.generator-changes.outputs.changes == 'true'
148+
env:
149+
TEST_ENV_DESTINATION_PATH: generator/gapic-generator-typescript/test-fixtures/google-cloud-speech
150+
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 ""
151+
152+
- name: Run tests for combined library (Speech)
153+
if: steps.generator-changes.outputs.changes == 'true'
154+
run: |
155+
set -ex
156+
cd generator/gapic-generator-typescript/test-fixtures/google-cloud-speech
157+
npm install
158+
npm test
159+
npm run system-test
160+
161+
- name: Test combined library (Tasks)
162+
if: steps.generator-changes.outputs.changes == 'true'
163+
env:
164+
TEST_ENV_DESTINATION_PATH: generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks
165+
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 ""
166+
167+
- name: Run tests for combined library (Tasks)
168+
if: steps.generator-changes.outputs.changes == 'true'
169+
run: |
170+
set -ex
171+
cd generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks
172+
npm install
173+
npm test
174+
npm run system-test

.github/workflows/syncpack.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
7+
name: syncpack
8+
9+
jobs:
10+
syncpack:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v5
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 18
17+
- run: npm install
18+
- run: npm install -g syncpack
19+
- run: syncpack lint --config core/.syncpackrc.json --source "core/packages/*/package.json"

0 commit comments

Comments
 (0)