Skip to content

Merge pull request #9 from semiotic-ai/joseph/tru-276-set-up-basic-ci… #8

Merge pull request #9 from semiotic-ai/joseph/tru-276-set-up-basic-ci…

Merge pull request #9 from semiotic-ai/joseph/tru-276-set-up-basic-ci… #8

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
fmt:
name: cargo fmt
runs-on: ubuntu-latest
container:
image: rust:1.80-bookworm
steps:
- uses: actions/checkout@v3
- run: |
rustup toolchain install nightly
rustup component add rustfmt --toolchain nightly
cargo +nightly fmt --all -- --check
clippy:
name: cargo clippy
runs-on: ubuntu-latest
container:
image: rust:1.80-bookworm
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
- name: Install Protoc
uses: arduino/setup-protoc@v3
- run: |
rustup component add clippy
cargo clippy --all-targets -- -D warnings
test:
name: cargo test
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
actions: read
container:
image: rust:1.80-bookworm
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
- name: Install Protoc
uses: arduino/setup-protoc@v3
- name: Run tests
run: cargo test --release --all-features -- --nocapture