-
Notifications
You must be signed in to change notification settings - Fork 29
130 lines (116 loc) · 3.65 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
name: Test and Build Rust
on:
push:
pull_request:
types: [reopened, opened]
schedule:
# Check if it works with current dependencies
- cron: "32 2 * * 3" # weekly on Wednesday 2:32 UTC
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- name: Setup Rust
shell: bash -eux {0}
run: |
rm ~/.cargo/bin/{rustfmt,cargo-fmt}
rustup toolchain install stable --profile minimal --component rustfmt
rustup default stable
- uses: actions/checkout@v4
- run: cargo fmt --check --verbose
test:
name: Test ${{ matrix.toolchain }} ${{ matrix.os }} ${{ matrix.features }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
strategy:
fail-fast: false
matrix:
toolchain:
- stable
os:
- ubuntu-latest
- macos-latest
- windows-latest
clippyargs:
- -D clippy::pedantic -D warnings
features:
- --no-default-features
- "" # default features
- --all-features
include:
# Check future versions and maybe get some glances on soon to be lints
- toolchain: beta
os: ubuntu-latest
features: --all-features
clippyargs: -W clippy::pedantic -W clippy::cargo
- toolchain: nightly
os: ubuntu-latest
features: --all-features
clippyargs: -W clippy::pedantic
steps:
- name: Setup Rust
shell: bash -eux {0}
run: |
rustup toolchain install ${{ matrix.toolchain }} --profile minimal --component clippy
rustup default ${{ matrix.toolchain }}
- uses: actions/checkout@v4
- name: Fetch dependencies
uses: actions-rs/cargo@v1
with:
command: fetch
args: --verbose
- name: Check clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --verbose --all-targets ${{ matrix.features }} -- ${{ matrix.clippyargs }}
- name: Check docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --verbose --no-deps ${{ matrix.features }}
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose ${{ matrix.features }}
release:
name: Release ${{ matrix.triple }}
runs-on: ${{ matrix.os }}
needs: test
strategy:
fail-fast: false
matrix:
include:
- triple: x86_64-unknown-linux-gnu
os: ubuntu-latest
- triple: aarch64-unknown-linux-gnu
os: ubuntu-latest
- triple: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
- triple: arm-unknown-linux-gnueabihf
os: ubuntu-latest
- triple: x86_64-apple-darwin
os: macos-latest
- triple: aarch64-apple-darwin
os: macos-latest
- triple: x86_64-pc-windows-msvc
os: windows-latest
# https://github.com/briansmith/ring/issues/1167
# - triple: aarch64-pc-windows-msvc
# os: windows-latest
steps:
- name: Setup Rust
shell: bash -eux {0}
run: |
rustup toolchain install stable --profile minimal --target ${{ matrix.triple }}
rustup default stable
- uses: actions/checkout@v4
- name: Fetch dependencies
run: cargo fetch --verbose
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --verbose --all-features --target ${{ matrix.triple }}
use-cross: ${{ runner.os == 'Linux' }}