nit #61
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: Rust CI | |
on: | |
push: | |
pull_request: | |
# Cancel in-progress workflows on branches, expect main. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ !contains(github.ref, 'main')}} | |
# TODO: Consider using composite actions to setup code duplication for each job | |
# https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-composite-action | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Set up cargo cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
- name: Lint | |
run: cargo clippy | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Set up cargo cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
- name: Build | |
run: cargo build | |
# Uncomment when tests are stable | |
# test: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Check out | |
# uses: actions/checkout@v4 | |
# - name: Set up cargo cache | |
# uses: actions/cache@v4 | |
# with: | |
# path: | | |
# ~/.cargo/bin/ | |
# ~/.cargo/registry/index/ | |
# ~/.cargo/registry/cache/ | |
# ~/.cargo/git/db/ | |
# target/ | |
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
# - name: Install Protoc | |
# uses: arduino/setup-protoc@v3 | |
# - name: Run tests | |
# run: cargo test --lib |