forked from stellar/soroban-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 1.73 KB
/
rust.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Rust
on:
push:
branches: [main, dev]
pull_request:
env:
RUSTFLAGS: -D warnings
jobs:
complete:
if: always()
needs: [fmt, rust-analyzer-compat, build-and-test, build-and-test-optimized]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update
- run: cargo fmt --all --check
rust-analyzer-compat:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update
- run: rustup +nightly component add rust-analyzer
- name: Check if rust-analyzer encounters any errors parsing project
run: rustup run nightly rust-analyzer analysis-stats . 2>&1 | (! grep ERROR)
build-and-test:
strategy:
matrix:
sys:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
runs-on: ${{ matrix.sys.os }}
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-cache@main
- run: rustup update
- run: rustup target add ${{ matrix.sys.target }}
- run: make test
env:
CARGO_BUILD_TARGET: ${{ matrix.sys.target }}
build-and-test-optimized:
strategy:
matrix:
sys:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
runs-on: ${{ matrix.sys.os }}
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-cache@main
- run: rustup update nightly
- run: rustup component add rust-src --toolchain nightly-${{ matrix.sys.target }}
- run: rustup target add ${{ matrix.sys.target }}
- run: make test-optimized
env:
CARGO_BUILD_TARGET: ${{ matrix.sys.target }}