1
+ # This checks fmt, clippy, and does build and test on each arch for each impl using cross
2
+
1
3
name : Rust
2
4
3
5
on :
6
8
pull_request :
7
9
branches : [ "master" ]
8
10
9
- env :
10
- CARGO_TERM_COLOR : always
11
-
12
11
jobs :
13
- build :
12
+ style :
13
+ name : Check Style
14
+ runs-on : ubuntu-latest
15
+
16
+ steps :
17
+ - name : Checkout
18
+ uses : actions/checkout@v3
19
+
20
+ - name : Install rust
21
+ uses : actions-rs/toolchain@v1
22
+ with :
23
+ toolchain : stable
24
+ components : rustfmt
25
+ profile : minimal
26
+ override : true
14
27
28
+ - name : Rustfmt check
29
+ uses : actions-rs/cargo@v1
30
+ with :
31
+ command : fmt
32
+ args : --all --check
33
+
34
+ test :
15
35
runs-on : ubuntu-latest
16
36
37
+ # TODO: add more platforms (all tier 1 and tier 2, tier 3 testing is optional)
38
+
39
+ strategy :
40
+ matrix :
41
+ impl :
42
+ - name : AES-NI
43
+ target :
44
+ - triple : x86_64-unknown-linux-gnu
45
+ caps : X86_64_UNKNOWN_LINUX_GNU
46
+ - triple : x86_64-pc-windows-msvc
47
+ caps : X86_64_UNKNOWN_PC_WINDOWS_MSVC
48
+ rustflags : -C target-feature=+sse4.1,+aes
49
+ channel : [stable, beta, nightly]
50
+ - name : AES-NI with VAES
51
+ target :
52
+ - triple : x86_64-unknown-linux-gnu
53
+ caps : X86_64_UNKNOWN_LINUX_GNU
54
+ - triple : x86_64-pc-windows-msvc
55
+ caps : X86_64_UNKNOWN_PC_WINDOWS_MSVC
56
+ rustflags : -C target-feature=+vaes
57
+ channel : [nightly]
58
+ - name : AES-NI with VAES and AVX-512
59
+ target :
60
+ - triple : x86_64-unknown-linux-gnu
61
+ caps : X86_64_UNKNOWN_LINUX_GNU
62
+ - triple : x86_64-pc-windows-msvc
63
+ caps : X86_64_UNKNOWN_PC_WINDOWS_MSVC
64
+ rustflags : -C target-feature=+vaes,+avx512f
65
+ channel : [nightly]
66
+ - name : Neon
67
+ target :
68
+ - triple : aarch64-unknown-linux-gnu
69
+ caps : AARCH64_UNKNOWN_LINUX_GNU
70
+ rustflags : -C target-feature=+aes
71
+ channel : [stable, beta, nightly]
72
+ - name : Risc-V RV64
73
+ target :
74
+ - triple : riscv64gc-unknown-linux-gnu
75
+ caps : RISCV64GC_UNKNOWN_LINUX_GNU
76
+ rustflags : -C target-feature=+zkne,+zknd
77
+ channel : [nightly]
78
+ - name : Risc-V RV32
79
+ target :
80
+ - triple : riscv32i-unknown-none-elf
81
+ caps : RISCV32I_UNKNOWN_NONE_ELF
82
+ rustflags : -C target-feature=+zkne,+zknd
83
+ channel : [nightly]
84
+ - name : Software AES
85
+ target :
86
+ - triple : x86_64-unknown-linux-gnu
87
+ caps : X86_64_UNKNOWN_LINUX_GNU
88
+ rustflags : -C target-feature=
89
+ channel : [stable, beta, nightly]
90
+ include :
91
+ - channel : nightly
92
+ features : --features=nightly
93
+
94
+ name : Test ${{ matrix.impl.name }} on ${{ matrix.impl.target.triple }}
95
+
17
96
steps :
18
- - uses : actions/checkout@v3
19
- - name : Build
20
- run : cargo build --verbose
21
- - name : Run tests
22
- run : cargo test --verbose
97
+ - uses : actions/checkout@v3
98
+
99
+ - name : Install Rust
100
+ uses : actions-rs/toolchain@v1
101
+ with :
102
+ toolchain : ${{ matrix.impl.channel }}
103
+ target : ${{ matrix.impl.target.triple }}
104
+ profile : minimal
105
+ components : clippy
106
+ override : true
107
+
108
+ - run : ${{ format('echo "CROSS_TARGET_{0}_RUSTFLAGS={1}" >> $GITHUB_ENV', matrix.impl.target.caps, matrix.impl.rustflags) }}
109
+
110
+ - name : Clippy
111
+ uses : actions-rs/cargo@v1
112
+ with :
113
+ command : clippy
114
+ args : ${{ format('--target {0} {1}', matrix.impl.target.triple, matrix.features || '') }}
115
+
116
+ - name : Build
117
+ uses : actions-rs/cargo@v1
118
+ with :
119
+ use-cross : true
120
+ command : build --verbose
121
+ args : ${{ format('--target {0} {1}', matrix.impl.target.triple, matrix.features || '') }}
122
+
123
+ - name : Test
124
+ uses : actions-rs/cargo@v1
125
+ with :
126
+ use-cross : true
127
+ command : test --verbose
128
+ args : ${{ format('--target {0} {1}', matrix.impl.target.triple, matrix.features || '') }}
0 commit comments