Skip to content

impl(internal/api): create package #761

impl(internal/api): create package

impl(internal/api): create package #761

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:
runs-on: ubuntu-24.04
strategy:
matrix:
rust-version: ['1.81', '1.70']
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
# TODO(#92) - disable the doc tests because the generated code contains non-rusty blockquotes
- run: cargo test --lib --bins --tests
- run: cargo test --package gcp-sdk-wkt --package google-cloud-auth --package check-copyright
lint:
runs-on: ubuntu-24.04
strategy:
matrix:
rust-version: ['1.81']
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: 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.81']
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 -project-root .. refreshall
- 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