Skip to content

chore: increase test coverage to 80% #6998

chore: increase test coverage to 80%

chore: increase test coverage to 80% #6998

Workflow file for this run

# 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: Rust & Sidekick
on: [push, pull_request, merge_group]
permissions:
contents: read
issues: write
jobs:
test:
runs-on: ubuntu-24.04
# Presubmit jobs must complete within 5 minutes. See CONTRIBUTING.md.
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
- uses: ./.github/actions/install-protoc
- name: Display Go version
run: go version
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Display Cargo version
run: cargo version
- name: Display rustc version
run: rustup show active-toolchain -v
- uses: ./.github/actions/install-taplo
- name: Verify git and tar are available
run: |
git --version
tar --version
- name: Run sidekick tests
run: go test -race ./internal/sidekick/...
- name: Run internal/librarian/rust tests
run: go test -race -coverprofile=coverage.out -covermode=atomic ./internal/librarian/rust
- name: Upload coverage report
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
integration:
runs-on: ubuntu-24.04
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
- uses: ./.github/actions/install-protoc
- name: Install librarian
run: go install ./cmd/librarian
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install-taplo
- name: Checkout google-cloud-rust
uses: actions/checkout@v6
with:
repository: googleapis/google-cloud-rust
path: google-cloud-rust
- name: Run librarian generate
working-directory: google-cloud-rust
run: librarian generate --all
- name: Run cargo check
working-directory: google-cloud-rust
run: cargo check -p google-cloud-showcase-v1beta1
create-issue-on-failure:
needs: [test, integration]
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: Rust
repository: google-cloud-rust