-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (44 loc) · 1.21 KB
/
rs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Rust - Build and test
on:
push:
branches:
- gen-rs
pull_request:
jobs:
build-test:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
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/chainselectors
run: cargo fmt --all -- --check
- name: cargo clippy
working-directory: rs/chainselectors
run: cargo clippy --all-targets --all-features -- -D warnings
- name: cargo test
working-directory: rs/chainselectors
run: cargo test
timeout-minutes: 1
- name: cargo build
working-directory: rs/chainselectors
run: cargo build