Skip to content

Commit

Permalink
rust workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
amirylm committed Nov 1, 2024
1 parent 4bbb182 commit 0dffa94
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/rs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Rust - Build and test

on: [ push ]

jobs:
build-test:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install rust toolchain
working-directory: ./rs/chainselectors
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
working-directory: ./rs/chainselector
with:
cache-on-failure: true
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
cache: false
- name: Make sure generated files are updated
run: |
if go generate ./rs | grep -q 'rust: no changes detected'; then
exit 0;
fi
exit 1;
- name: cargo fmt
working-directory: ./rs/chainselector
run: cargo fmt --all -- --check
- name: cargo clippy
working-directory: ./rs/chainselector
run: cargo clippy --all-targets --all-features -- -D warnings
- name: cargo test
working-directory: ./rs/chainselector
run: cargo test
timeout-minutes: 1
- name: cargo build
working-directory: ./rs/chainselector
run: cargo build

0 comments on commit 0dffa94

Please sign in to comment.