-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from semiotic-ai/joseph/tru-276-set-up-basic-ci…
…-in-sf-protos ci: set up Rust CI checks
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
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 |
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