Skip to content

Commit

Permalink
Merge pull request #9 from semiotic-ai/joseph/tru-276-set-up-basic-ci…
Browse files Browse the repository at this point in the history
…-in-sf-protos

ci: set up Rust CI checks
  • Loading branch information
suchapalaver authored Aug 26, 2024
2 parents 2010a6b + 53f9c96 commit c29dee8
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/tests.yaml
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
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "sf-protos"
version = "0.1.0"
edition = "2021"

[lib]
doctest = false

[dependencies]
alloy-primitives = "=0.7.7"
ethportal-api = { git = "https://github.com/ethereum/trin.git", version = "0.2.2", tag = "v0.1.0-alpha.35" }
Expand Down

0 comments on commit c29dee8

Please sign in to comment.