forked from stellar/rs-soroban-env
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (120 loc) · 3.9 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Rust
on:
push:
branches: [main, release/**]
pull_request:
merge_group:
jobs:
complete:
if: always()
# temporarily disabling publish-dry-run, it appears to be broken with recent
# changes to dependency specifications?
# needs: [fmt, cackle, cargo-deny, check-git-rev-deps, build-and-test, publish-dry-run]
needs: [fmt, cackle, cargo-deny, check-git-rev-deps, semver-checks, build-and-test]
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
cackle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cackle-rs/cackle-action@997327f77e59d9cda7b0b6217f0fbdbd3f3ca904
- run: cargo acl -n run
cargo-deny:
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories
- bans licenses sources
# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@b01e7a8cfb1f496c52d77361e84c1840d8246393
with:
command: check ${{ matrix.checks }}
check-git-rev-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-check-git-rev-deps@main
rust-analyzer-compat:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update
- run: rustup component add rust-analyzer
- name: Check if rust-analyzer encounters any errors parsing project
run: rust-analyzer analysis-stats . 2>&1 | (! grep ERROR)
semver-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update
- uses: stellar/binaries@v18
with:
name: cargo-semver-checks
version: 0.27.0
- run: cargo semver-checks --exclude soroban-simulation
build-and-test:
strategy:
matrix:
rust: [msrv, latest]
sys:
- os: ubuntu-latest
target: wasm32-unknown-unknown
test: false
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
test: true
# TODO: Re-enable these builds if we see value in doing so.
# - os: macos-latest
# target: x86_64-apple-darwin
# test: true
# - os: macos-latest
# target: aarch64-apple-darwin
# test: false
# - os: windows-latest
# target: x86_64-pc-windows-msvc
# test: true
runs-on: ${{ matrix.sys.os }}
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-cache@main
- name: Use the minimum supported Rust version
if: matrix.rust == 'msrv'
run: |
msrv="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages | map(.rust_version) | map(values) | min')"
rustup override set $msrv
rustup component add clippy --toolchain $msrv
- run: rustup update
- run: cargo version
- run: rustup target add ${{ matrix.sys.target }}
- uses: stellar/binaries@v18
with:
name: cargo-hack
version: 0.5.28
- run: cargo hack --each-feature clippy --locked --target ${{ matrix.sys.target }}
- if: matrix.sys.test
run: cargo hack --each-feature test --profile test-opt --locked --target ${{ matrix.sys.target }}
publish-dry-run:
if: github.event_name == 'push' || startsWith(github.head_ref, 'release/')
strategy:
matrix:
sys:
- os: ubuntu-latest
target: wasm32-unknown-unknown
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
uses: stellar/actions/.github/workflows/rust-publish-dry-run.yml@main
with:
runs-on: ${{ matrix.sys.os }}
target: ${{ matrix.sys.target }}