Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/actions/run-unit-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,19 @@ runs:
with:
node-version: ${{ inputs.node-version }}
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- name: Install Workspace Dependencies (Frozen Lockfile)
run: pnpm install --frozen-lockfile --ignore-scripts
shell: bash
- name: Cache Turborepo
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
version: ^10.0.0
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Compile Workspace (Turborepo Caching)
run: pnpm run compile
shell: bash
- run: node --version
shell: bash
- name: Run unit tests
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/bigtable-conformance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
with:
go-version: '>=1.20.2'
- run: chmod +x .kokoro/conformance.sh
- run: npm install
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm --filter ...{handwritten/bigtable} run --if-present compile
- run: go version
- run: .kokoro/conformance.sh
8 changes: 6 additions & 2 deletions .github/workflows/continuous.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ jobs:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
version: ^7.0.0
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- name: Install Workspace Dependencies (Frozen Lockfile)
run: pnpm install --frozen-lockfile --ignore-scripts
- run: node --version
- run: ci/run_conditional_tests.sh
name: Run unit tests
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/discovery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,16 @@ jobs:
contents: read
issues: write # Added for creating issues on failure
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
version: ^10.0.0

# Install all deps, including dev dependencies.
- run: cd handwritten/bigquery && pnpm install
- run: cd handwritten/bigquery && pnpm install --filter .
# Generate types
- run: cd handwritten/bigquery && pnpm run types
# Fix formatting (scoped to generated types.d.ts and clean up untracked pnpm-lock.yaml)
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/generation_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ jobs:
- name: Setup pnpm
if: steps.changes.outputs.librarian == 'true' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
version: ^7.0.0
- name: Install tools
if: steps.changes.outputs.librarian == 'true' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
run: librarian install
Expand Down
66 changes: 41 additions & 25 deletions .github/workflows/generator-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,37 +84,53 @@ jobs:
working-directory: core/generator/gapic-generator-typescript
run: |
set -ex
npm install -g pnpm@10.0.0 --silent
cp ../../../.mocharc.cjs .
unzip ~/artifacts/outputs.zip -d library
FAIL=0
for lib in showcase kms translate monitoring dlp texttospeech showcase-legacy compute logging bigquery-v2 redis retail; do
echo "--- Testing library $lib ---"
cd library/.test-out-$lib
npm install
npm test
npm run fix
rm -rf build
npm run compile
npm run system-test
npm run docs
cd ../..
(
set -ex
echo "--- Testing library $lib ---"
cd library/.test-out-$lib
pnpm install --no-frozen-lockfile --silent
pnpm test
pnpm run compile
pnpm run system-test
) &
done
for job in $(jobs -p); do
wait "$job" || FAIL=1
done
if [ "$FAIL" -ne 0 ]; then
echo "Some library tests failed!"
exit 1
fi

- name: Test generated ESM libraries
working-directory: core/generator/gapic-generator-typescript
run: |
set -ex
cp ../../../.mocharc.cjs .
FAIL=0
for lib in showcase kms translate monitoring dlp texttospeech showcase-legacy compute logging bigquery-v2 redis retail; do
echo "--- Testing ESM library $lib ---"
cd library/.test-out-$lib-esm
npm install
npm test
npm run fix
rm -rf build
npm run compile
npm run system-test
cd ../..
(
set -ex
echo "--- Testing ESM library $lib ---"
cd library/.test-out-$lib-esm
pnpm install --no-frozen-lockfile --silent
pnpm test
pnpm run compile
pnpm run system-test
) &
done
for job in $(jobs -p); do
wait "$job" || FAIL=1
done
if [ "$FAIL" -ne 0 ]; then
echo "Some ESM library tests failed!"
exit 1
fi
- name: Test combined library (Speech)
if: steps.generator-changes.outputs.changes == 'true'
env:
Expand All @@ -126,9 +142,9 @@ jobs:
run: |
set -ex
cd generator/gapic-generator-typescript/test-fixtures/google-cloud-speech
npm install
npm test
npm run system-test
pnpm install --no-frozen-lockfile --silent
pnpm test
pnpm run system-test

- name: Test combined library (Tasks)
if: steps.generator-changes.outputs.changes == 'true'
Expand All @@ -141,6 +157,6 @@ jobs:
run: |
set -ex
cd generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks
npm install
npm test
npm run system-test
pnpm install --no-frozen-lockfile --silent
pnpm test
pnpm run system-test
4 changes: 3 additions & 1 deletion .github/workflows/mandatory-conformance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
with:
go-version: '>=1.20.2'
- run: chmod +x .kokoro/mandatory-conformance.sh
- run: npm install
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm --filter ...{handwritten/bigtable} run --if-present compile
- run: go version
- run: .kokoro/mandatory-conformance.sh
13 changes: 10 additions & 3 deletions .github/workflows/presubmit-bun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,18 @@ jobs:
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: ${{ matrix.node-version }}
# We continue to use PNPM (rather than Bun) for installation for consistent
# lockfile/version management between CI/runtimes.
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- name: Install Workspace Dependencies (Frozen Lockfile)
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Cache Turborepo
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
version: ^10.0.0
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Compile Workspace (Turborepo Caching)
run: pnpm run compile
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.14
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,18 @@ jobs:
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: 24
- run: npm install
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- name: Install Workspace Dependencies (Frozen Lockfile)
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Cache Turborepo
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Compile Workspace (Turborepo Caching)
run: pnpm run compile
- run: node ./bin/linter.mjs --strict
name: Run monorepo linter
env:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/storage-conformance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ jobs:
conformance-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
- run: node --version
- run: cd handwritten/storage && npm install
- run: cd handwritten/storage && npm run conformance-test
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm --filter ...{handwritten/storage} run --if-present compile
- run: cd handwritten/storage && pnpm run conformance-test
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ packages/*/AUTHORS
packages/*/CONTRIBUTORS
packages/*/COPYING
package-lock.json
yarn.lock
bun.lockb
bun.lock
**/pnpm-lock.yaml
!/pnpm-lock.yaml
__pycache__
packages/*/pnpm-lock.yaml
containers/*/pnpm-lock.yaml
**/docs.metadata
**/backstory/
*.tsbuildinfo
.turbo
2 changes: 1 addition & 1 deletion .mocharc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
const config = {
"enable-source-maps": true,
"throw-deprecation": true,
"timeout": 10000,
"timeout": 60000,
"parallel": true,
"recursive": true
}
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
link-workspace-packages=false
25 changes: 0 additions & 25 deletions .pnpmfile.cjs

This file was deleted.

4 changes: 2 additions & 2 deletions bin/linter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function getChangedFiles() {
return output
.split('\n')
.map(f => f.trim())
.filter(f => f.length > 0 && existsSync(f));
.filter(f => f.length > 0 && existsSync(f) && !f.includes('/fixtures/'));
} catch {
// Continue to the next fallback ref
}
Expand All @@ -167,7 +167,7 @@ function getChangedFiles() {
return output
.split('\n')
.map(f => f.trim())
.filter(f => f.length > 0 && existsSync(f));
.filter(f => f.length > 0 && existsSync(f) && !f.includes('/fixtures/'));
} catch {
return [];
}
Expand Down
4 changes: 2 additions & 2 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN curl https://github.com/googleapis/repo-automation-bots/releases/download/fl
-o /bin/flakybot -s -L \
&& chmod +x /bin/flakybot

ENV PNPM_VERSION=7.32.2
ENV PNPM_VERSION=10.0.0
RUN npm install -g pnpm@${PNPM_VERSION}

FROM node:${NODE_VERSION}-slim
Expand All @@ -44,7 +44,7 @@ COPY --from=build /bin/flakybot /bin/flakybot
RUN apt-get update && apt-get install -y git bash python3 jq \
&& ln -s /usr/bin/python3 /usr/bin/python

ENV PNPM_VERSION=7.32.2
ENV PNPM_VERSION=10.0.0
RUN npm install -g pnpm@${PNPM_VERSION}

ENV PATH=/usr/local/gcloud/google-cloud-sdk/bin:$PATH
9 changes: 8 additions & 1 deletion ci/run_conditional_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,14 @@ for subdir in ${subdirs[@]}; do

# Our CI uses Git Bash on Windows to execute this script, which returns "msys" or "cygwin" for OSTYPE.
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || "$OS" == "Windows_NT" ]]; then
if [[ "${windows_exempt_tests}" =~ "${d}" ]]; then
is_exempt=false
for exempt in ${windows_exempt_tests}; do
if [[ "${d}" == "${exempt}"* ]]; then
is_exempt=true
break
fi
done
if [[ "${is_exempt}" == "true" ]]; then
echo "Skipping ${d} on Windows (in exemption list)"
continue
fi
Expand Down
5 changes: 3 additions & 2 deletions core/common/.kokoro/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export NPM_CONFIG_PREFIX=${HOME}/.npm-global

cd $(dirname $0)/..

npm install
npm install -g pnpm@9
pnpm install

npm run docs-test
pnpm run docs-test
8 changes: 5 additions & 3 deletions core/common/.kokoro/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ export NPM_CONFIG_PREFIX=${HOME}/.npm-global

cd $(dirname $0)/..

npm install
npm install -g pnpm@9
pnpm install

# Install and link samples
if [ -f samples/package.json ]; then
cd samples/
npm link ../
npm install
npm install -g pnpm@9
pnpm install
cd ..
fi

npm run lint
pnpm run lint
3 changes: 2 additions & 1 deletion core/common/.kokoro/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ cd $(dirname $0)/..
NPM_TOKEN=$(cat $KOKORO_KEYSTORE_DIR/73713_google-cloud-npm-token-1)
echo "//wombat-dressing-room.appspot.com/:_authToken=${NPM_TOKEN}" > ~/.npmrc

npm install
npm install -g pnpm@9
pnpm install
npm pack .
# npm provides no way to specify, observe, or predict the name of the tarball
# file it generates. We have to look in the current directory for the freshest
Expand Down
Loading
Loading