diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..7a06ed5 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,37 @@ +name: Rust + +on: + push: + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: ⚡ Cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} + - name: Set up nightly + run: rustup default nightly + - name: Install dependencies + run: rustup component add clippy rustfmt + - name: Build sequencer + run: cd sequencer && cargo build --verbose + - name: Run sequencer tests + run: cd sequencer && cargo test --verbose + - name: Lint + run: cd sequencer && cargo clippy --all --all-features -- -D warnings + - name: Format + run: cd sequencer && cargo fmt --check --verbose diff --git a/sequencer/rust-toolchain.toml b/sequencer/rust-toolchain.toml index 0d6852f..5d56faf 100644 --- a/sequencer/rust-toolchain.toml +++ b/sequencer/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2023-01-03" +channel = "nightly"