-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (57 loc) · 2.83 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
name: Rust
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
test-on-min-supported-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update 1.70.0 --no-self-update && rustup default 1.70.0
- { name: "cargo build", run: "cargo build --verbose" }
- { name: "cargo test", run: "cargo test --verbose" }
- { name: "cargo test --release", run: "cargo test --verbose --release" }
test-on-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- { name: "cargo build", run: "cargo build --verbose" }
- { name: "cargo test", run: "cargo test --verbose" }
- { name: "cargo test --release", run: "cargo test --verbose --release" }
- { name: "cargo clippy", run: "cargo clippy" }
- { name: "example user", run: "cargo run --example user" }
crosscompile-for-linux-32bit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- { name: "print target list", run: "rustc --print target-list" }
- { name: "add 32bit target", run: "rustup target add i686-unknown-linux-gnu" }
- { name: "add gcc-multilib", run: "sudo apt install -y gcc-multilib" }
- { name: "cargo build", run: "cargo build --target i686-unknown-linux-gnu --verbose" }
- { name: "cargo test", run: "cargo test --target i686-unknown-linux-gnu --verbose" }
- { name: "cargo test --release", run: "cargo test --target i686-unknown-linux-gnu --verbose --release" }
- { name: "cargo clippy", run: "cargo clippy --target i686-unknown-linux-gnu" }
crosscompile-for-windows:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- { name: "add x86_64-pc-windows-gnu target", run: "rustup target add x86_64-pc-windows-gnu" }
- { name: "add i686-pc-windows-gnu target", run: "rustup target add i686-pc-windows-gnu" }
- { name: "cross-compile for win-x86_64", run: "cargo build --target x86_64-pc-windows-gnu" }
- { name: "cross-compile for win-i686", run: "cargo build --target i686-pc-windows-gnu" }
test-on-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- run: rustup update stable --no-self-update && rustup default stable
- { name: "cargo build", run: "cargo build --verbose" }
- { name: "cargo test", run: "cargo test --verbose" }
- { name: "cargo test --release", run: "cargo test --verbose --release" }
- { name: "cargo clippy", run: "cargo clippy" }
- { name: "example user", run: "cargo run --example user" }
- { name: "add 32bit target", run: "rustup target add i686-pc-windows-msvc" }
- { name: "cargo clippy 32bit", run: "cargo clippy --target i686-pc-windows-msvc" }