|
1 |
| -name: Contract tests and checks |
| 1 | +name: Tests and Checks |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | pull_request:
|
|
10 | 10 | CARGO_TERM_COLOR: always
|
11 | 11 |
|
12 | 12 | jobs:
|
13 |
| - test_and_check: |
14 |
| - name: Test and check |
15 |
| - runs-on: ubuntu-latest |
16 |
| - |
| 13 | + rust-lint-and-tests: |
| 14 | + runs-on: ubuntu-22.04 |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + manifest: |
| 18 | + - sdk/rust/Cargo.toml |
17 | 19 | steps:
|
18 | 20 | - name: Cancel Previous Runs
|
19 | 21 | uses: styfle/cancel-workflow-action@0.9.1
|
20 | 22 | with:
|
21 | 23 | access_token: ${{ github.token }}
|
22 | 24 |
|
23 |
| - - name: Checkout sources |
| 25 | + - name: Check out source |
24 | 26 | uses: actions/checkout@v2
|
25 |
| - - uses: actions/cache@v2 |
26 |
| - with: |
27 |
| - path: | |
28 |
| - ~/.cargo/bin |
29 |
| - ~/.cargo/git/checkouts |
30 |
| - ~/.cargo/git/db |
31 |
| - ~/.cargo/registry/cache |
32 |
| - ~/.cargo/registry/index |
33 |
| - target |
34 |
| - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
35 | 27 |
|
36 |
| - - name: Install stable toolchain |
| 28 | + - name: Install stable rust toolchain |
37 | 29 | uses: actions-rs/toolchain@v1
|
38 | 30 | with:
|
39 | 31 | profile: minimal
|
40 |
| - toolchain: 1.60.0 |
41 |
| - override: true |
42 |
| - components: rustfmt, clippy |
43 |
| - |
44 |
| - - name: Set up Python |
45 |
| - uses: actions/setup-python@v2 |
46 |
| - with: |
47 |
| - python-version: 3.9.7 |
48 |
| - |
49 |
| - - name: Run tests |
50 |
| - uses: actions-rs/cargo@v1 |
51 |
| - with: |
52 |
| - command: test |
53 |
| - args: --no-fail-fast --locked |
54 |
| - env: |
55 |
| - RUST_BACKTRACE: 1 |
56 |
| - |
57 |
| - - name: Run cargo clippy |
58 |
| - uses: actions-rs/cargo@v1 |
59 |
| - with: |
60 |
| - command: clippy |
61 |
| - args: -- -D warnings |
62 |
| - |
63 |
| - - name: Run cargo fmt |
64 |
| - uses: actions-rs/cargo@v1 |
65 |
| - with: |
66 |
| - command: fmt |
67 |
| - args: --all -- --check |
68 |
| - |
| 32 | + toolchain: stable |
| 33 | + components: clippy, rustfmt |
| 34 | + default: true |
| 35 | + |
| 36 | + - run: cargo fetch --verbose --locked |
| 37 | + - run: cargo check --verbose --workspace --locked --all-targets |
| 38 | + - run: cargo test --verbose --workspace --locked --no-fail-fast |
| 39 | + - run: cargo clippy --all --all-targets -- -D warnings |
| 40 | + - run: cargo fmt --all -- --check |
69 | 41 | - run: ./bin/generate_schemas.sh
|
70 | 42 | - name: Schema Changes
|
71 | 43 | run: git diff --exit-code
|
72 |
| - |
0 commit comments