test(pubsub): add simple integration test (#3356) #4916
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2025 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: Client Generator - Dart | |
permissions: read-all | |
# Run on PRs and pushes to the default branch. | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
# We use a specific Dart SDK version here in order to have hermetic, | |
# reproducable builds (formatting can change between SDK versions, ...). | |
env: | |
DART_VERSION: 3.9.2 | |
jobs: | |
generator-build: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Install protoc | |
run: | | |
set -e | |
curl -fSSL --retry 3 --retry-all-errors --retry-delay 15 -o /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-x86_64.zip | |
cd /usr/local | |
sudo unzip -x /tmp/protoc.zip | |
protoc --version | |
- name: Install Go | |
uses: actions/setup-go@v6 | |
with: | |
go-version: 1.25.0 | |
- name: Install Dart | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: ${{ env.DART_VERSION }} | |
# Run pub get. | |
- run: dart pub get | |
working-directory: dart | |
# Regenerate and check the existing clients. If there is any difference | |
# between the generated code and the committed code that is an error; all | |
# the inputs should be pinned, including the generator version and the | |
# googleapis SHA. | |
- name: Regenerate existing clients | |
run: go run github.com/googleapis/librarian/cmd/[email protected] refreshall -project-root dart | |
- run: git diff --exit-code | |
validate-packages: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: ${{ env.DART_VERSION }} | |
# Run pub get. | |
- run: dart pub get | |
working-directory: dart | |
# Analyze code. | |
- run: dart analyze examples | |
working-directory: dart | |
- run: dart analyze generated | |
working-directory: dart | |
- run: dart analyze packages | |
working-directory: dart | |
- run: dart analyze tests | |
working-directory: dart | |
# Run tests. | |
- name: "dart/tests" | |
run: dart test | |
working-directory: dart/tests | |
- name: "test package:google_cloud_longrunning" | |
run: dart test | |
working-directory: dart/generated/google_cloud_longrunning | |
- name: "test package:google_cloud_protobuf" | |
run: dart test | |
working-directory: dart/generated/google_cloud_protobuf | |
- name: "test package:google_cloud_gax" | |
run: dart test | |
working-directory: dart/packages/google_cloud_gax | |
- name: "test package:google_cloud_rpc" | |
run: dart test | |
working-directory: dart/generated/google_cloud_rpc |