Skip to content

ci(node): generate a single library as a smoke test during presubmits, and generate --all in postsubmits #4419

ci(node): generate a single library as a smoke test during presubmits, and generate --all in postsubmits

ci(node): generate a single library as a smoke test during presubmits, and generate --all in postsubmits #4419

Workflow file for this run

# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Go
on: [push, pull_request, merge_group]
permissions:
contents: read
jobs:
build-and-test:
name: ${{ matrix.job-name }}
runs-on: ubuntu-24.04
# Presubmit jobs must complete within 5 minutes. Integration might take longer.
timeout-minutes: ${{ matrix.timeout }}
# Skip integration test unless it's a push to main
strategy:
fail-fast: false
matrix:
include:
- job-name: 'Unit Tests'
task: 'unit-test'
timeout: 5
- job-name: 'Smoke Test'
task: 'smoke-test'
timeout: 5
- job-name: 'Integration Test'
task: 'integration'
timeout: 60
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- uses: ./.github/actions/setup-librarian
- name: Checkout google-cloud-go
if: matrix.task != 'unit-test'
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
repository: googleapis/google-cloud-go
path: google-cloud-go
persist-credentials: false
- name: Run librarian install
if: matrix.task != 'unit-test'
working-directory: google-cloud-go
run: librarian install
- name: Run Unit Tests
if: matrix.task == 'unit-test'
run: go run ./tool/cmd/coverage ./internal/librarian/golang
- name: Generate a single library (smoke test)
if: matrix.task == 'smoke-test'
working-directory: google-cloud-go
run: librarian generate secretmanager
- name: Run librarian generate all (integration test)
if: matrix.task == 'integration' && github.event_name == 'push' && github.ref == 'refs/heads/main'
working-directory: google-cloud-go
run: librarian generate --all
create-issue-on-failure:
needs: [build-and-test]
permissions:
contents: read
issues: write
if: ${{ always() && contains(needs.*.result, 'failure') && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: ./.github/workflows/create-issue-on-failure.yaml
with:
language: Go
repository: google-cloud-go