install protoc for lint #4
This file contains 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
name: Test | |
# rust build jobs based off of [hyperfine's CI](https://github.com/sharkdp/hyperfine/blob/e8ff88dad130d4b4bc2362be92aa8dfedc35074a/.github/workflows/CICD.yml#L71-L84) | |
# Linker Rustflags [just's ci](https://github.com/casey/just/blob/b4efe2628a8d0e8f936498f5ac5fd5764f4063f8/.github/workflows/release.yaml) | |
on: | |
push: | |
branches: | |
- "*" | |
paths-ignore: | |
- LICENSE.txt | |
- README.adoc | |
- renovate.json | |
- flake.lock | |
- flake.nix | |
- .gitignore | |
- .envrc | |
pull_request: | |
workflow_dispatch: | |
env: | |
CICD_INTERMEDIATES_DIR: '_cicd-intermediates' | |
jobs: | |
build-client-rs: | |
name: Build rust client | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install rubygems | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1.4' | |
bundler-cache: true | |
working-directory: server | |
- name: Install protobuf | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: protoc,just | |
- name: Install Rust toolchain | |
id: rust-toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: client-rs | |
key: ci-rust-${{ steps.rust-toolchain.outputs.toolchain }} | |
- name: Lint | |
run: cargo clippy --no-deps --all-targets -- -D warnings | |
working-directory: client-rs | |
- name: Format | |
run: cargo fmt --check | |
working-directory: client-rs | |
- name: Build | |
run: cargo build --locked | |
working-directory: client-rs | |
- name: Test | |
run: just test-ci |