-
Notifications
You must be signed in to change notification settings - Fork 1
137 lines (121 loc) · 4.04 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
132
133
134
135
136
137
# This checks fmt, clippy, and does build and test on each arch for each impl using cross
name: Rust
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
style:
name: Check Style
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
profile: minimal
override: true
- name: Rustfmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --check
test:
runs-on: ubuntu-latest
# TODO: add more platforms (all tier 1 and tier 2, tier 3 testing is optional)
strategy:
matrix:
impl:
- name: AES-NI
target:
- triple: x86_64-unknown-linux-gnu
caps: X86_64_UNKNOWN_LINUX_GNU
- triple: x86_64-pc-windows-msvc
caps: X86_64_UNKNOWN_PC_WINDOWS_MSVC
rustflags: -C target-feature=+sse4.1,+aes
channel:
- stable
- beta
- nightly
- name: AES-NI with VAES
target:
- triple: x86_64-unknown-linux-gnu
caps: X86_64_UNKNOWN_LINUX_GNU
- triple: x86_64-pc-windows-msvc
caps: X86_64_UNKNOWN_PC_WINDOWS_MSVC
rustflags: -C target-feature=+vaes
channel: nightly
- name: AES-NI with VAES and AVX-512
target:
- triple: x86_64-unknown-linux-gnu
caps: X86_64_UNKNOWN_LINUX_GNU
- triple: x86_64-pc-windows-msvc
caps: X86_64_UNKNOWN_PC_WINDOWS_MSVC
rustflags: -C target-feature=+vaes,+avx512f
channel: nightly
- name: Neon
target:
- triple: aarch64-unknown-linux-gnu
caps: AARCH64_UNKNOWN_LINUX_GNU
rustflags: -C target-feature=+aes
channel:
- stable
- beta
- nightly
- name: Risc-V RV64
target:
- triple: riscv64gc-unknown-linux-gnu
caps: RISCV64GC_UNKNOWN_LINUX_GNU
rustflags: -C target-feature=+zkne,+zknd
channel: nightly
- name: Risc-V RV32
target:
- triple: riscv32i-unknown-none-elf
caps: RISCV32I_UNKNOWN_NONE_ELF
rustflags: -C target-feature=+zkne,+zknd
channel: nightly
- name: Software AES
target:
- triple: x86_64-unknown-linux-gnu
caps: X86_64_UNKNOWN_LINUX_GNU
rustflags: -C target-feature=
channel:
- stable
- beta
- nightly
include:
- channel: nightly
features: --features=nightly
name: Test ${{ matrix.impl.name }} on ${{ matrix.impl.target.triple }}
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.impl.channel }}
target: ${{ matrix.impl.target.triple }}
profile: minimal
components: clippy
override: true
- run: ${{ format('echo "CROSS_TARGET_{0}_RUSTFLAGS={1}" >> $GITHUB_ENV', matrix.impl.target.caps, matrix.impl.rustflags) }}
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: ${{ format('--target {0} {1}', matrix.impl.target.triple, matrix.features || '') }}
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build --verbose
args: ${{ format('--target {0} {1}', matrix.impl.target.triple, matrix.features || '') }}
- name: Test
uses: actions-rs/cargo@v1
with:
use-cross: true
command: test --verbose
args: ${{ format('--target {0} {1}', matrix.impl.target.triple, matrix.features || '') }}