-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (111 loc) · 3.52 KB
/
rust.yml
File metadata and controls
116 lines (111 loc) · 3.52 KB
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
name: Rust CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
name: build (${{ matrix.job.common }})
strategy:
matrix:
job:
- { name: linux-x86_64, common: Linux x86 (64-Bit), target: x86_64-unknown-linux-gnu, output: storagereloaded }
- { name: linux-x86, common: Linux x86 (32-Bit), target: i686-unknown-linux-gnu, output: storagereloaded }
- { name: linux-aarch64, common: Linux ARM64, target: aarch64-unknown-linux-gnu, output: storagereloaded }
- { name: linux-armv7, common: Linux ARMv7, target: armv7-unknown-linux-gnueabihf, output: storagereloaded }
- { name: linux-arm, common: Linux ARM, target: arm-unknown-linux-gnueabihf, output: storagereloaded }
- { name: windows-x86_64, common: Windows x86 (64-Bit), target: x86_64-pc-windows-gnu, output: storagereloaded.exe }
- { name: windows-x86, common: Windows x86 (32-Bit), target: i686-pc-windows-gnu, output: storagereloaded.exe }
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.job.target }}
override: true
- name: Setup cache
uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.job.name }}
- name: Build with Cargo
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=${{ matrix.job.target }}
- name: Upload Binary
uses: actions/upload-artifact@v2
with:
name: "Build for ${{ matrix.job.common }}"
path: target/${{ matrix.job.target }}/release/${{ matrix.job.output }}
check:
runs-on: ubuntu-latest
name: check (${{ matrix.job.name }})
strategy:
matrix:
job:
- { name: latest, toolchain: stable }
- { name: msrv, toolchain: 1.58.1 }
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.job.toolchain }}
override: true
- name: Setup cache
uses: Swatinem/rust-cache@v1
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
test:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Setup cache
uses: Swatinem/rust-cache@v1
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
lints:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Setup cache
uses: Swatinem/rust-cache@v1
- name: Install typos
uses: actions-rs/install@v0.1
with:
crate: typos-cli
version: latest
use-tool-cache: true
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- name: Run typos
run: typos