Skip to content

feat(gax): introduce BackoffPolicy #1422

feat(gax): introduce BackoffPolicy

feat(gax): introduce BackoffPolicy #1422

Workflow file for this run

# Copyright 2024 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 SDK
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
os: ['macos-14', 'ubuntu-24.04', 'windows-2022']
rust-version: ['1.83']
include:
- os: 'ubuntu-24.04'
rust-version: '1.70'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo
key: ${{ github.job }}-${{ runner.os }}-${{ matrix.rust-version }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: Setup Rust ${{ matrix.rust-version }}
run: rustup toolchain install ${{ matrix.rust-version }}
- name: Display Cargo version
run: cargo version
- name: Display rustc version
run: rustc --version
- run: cargo test
coverage:
runs-on: ubuntu-24.04
strategy:
matrix:
rust-version: ['1.83']
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo
key: ${{ github.job }}-${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: Setup Rust ${{ matrix.rust-version }}
run: |
set -e
rustup toolchain install ${{ matrix.rust-version }}
cargo install cargo-tarpaulin
- name: Display Cargo version
run: cargo version
- name: Display rustc version
run: rustc --version
- run: cargo tarpaulin --out xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
lint:
runs-on: ubuntu-24.04
strategy:
matrix:
rust-version: ['1.83']
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo
key: ${{ github.job }}-${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: Setup Rust ${{ matrix.rust-version }}
run: rustup toolchain install ${{ matrix.rust-version }}
- name: Display Cargo version
run: cargo version
- name: Display rustc version
run: rustc --version
- run: cargo clippy -- --deny warnings
- run: cargo fmt
- run: cargo doc
env:
RUSTDOCFLAGS: "-D warnings"
- run: git diff --exit-code
regenerate:
# Verifies the generated code has not been tampered with. Or maybe that the
# code requires no tampering.
runs-on: ubuntu-24.04
strategy:
matrix:
rust-version: ['1.83']
go-version: ['1.23']
steps:
- uses: actions/cache@v4
with:
path: |
~/.cache/sidekick
key: ${{ github.job }}-${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- uses: actions/checkout@v4
- name: Setup Rust ${{ matrix.rust-version }}
run: rustup toolchain install ${{ matrix.rust-version }}
- name: Display Cargo version
run: cargo version
- name: Display rustc version
run: rustc --version
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: |
generator/go.sum
- name: Install protoc
run: |
set -e
curl -fSSL -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: Regenerate all the code
working-directory: generator
run: go run ./cmd/sidekick refreshall -project-root ..
- run: cargo fmt
# 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.
- run: git diff --exit-code