Skip to content

Commit 45e686d

Browse files
committed
fixing testing harness
1 parent 54f5b8d commit 45e686d

File tree

3 files changed

+96
-136
lines changed

3 files changed

+96
-136
lines changed

.github/workflows/common.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ jobs:
3636
caps: X86_64_UNKNOWN_LINUX_GNU
3737
- triple: aarch64-unknown-linux-gnu
3838
caps: AARCH64_UNKNOWN_LINUX_GNU
39+
- triple: riscv64gc-unknown-linux-gnu
40+
caps: RISCV64GC_UNKNOWN_LINUX_GNU
41+
- triple: riscv32i-unknown-none-elf
42+
caps: RISCV64GC_UNKNOWN_NONE_ELF
43+
- triple: i686-unknown-linux-gnu
44+
caps: I686_UNKNOWN_LINUX_GNU
3945
channel:
4046
- stable
4147
- beta
@@ -44,5 +50,4 @@ jobs:
4450
with:
4551
target: ${{ matrix.target.triple }}
4652
target-in-caps: ${{ matrix.target.caps }}
47-
channel: ${{ matrix.channel }}
48-
secrets: inherit
53+
channel: ${{ matrix.channel }}

.github/workflows/runtest.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Run Test
2+
on:
3+
workflow_call:
4+
inputs:
5+
target:
6+
required: true
7+
type: string
8+
channel:
9+
required: true
10+
type: boolean
11+
target-feature:
12+
required: false
13+
type: string
14+
default: ''
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
continue-on-error: ${{ inputs.channel == 'nightly' }}
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- run: ${{ format('echo "{0}" >> $GITHUB_ENV', inputs.target-feature) }}
23+
24+
- name: Install Rust
25+
uses: actions-rs/toolchain@v1
26+
with:
27+
toolchain: ${{ inputs.channel }}
28+
target: ${{ inputs.target }}
29+
profile: minimal
30+
components: clippy
31+
override: true
32+
33+
- name: Clippy
34+
uses: actions-rs/cargo@v1
35+
with:
36+
command: clippy
37+
args: --target ${{ inputs.target }} ${{ inputs.channel == 'nightly' && '--features=nightly' || '' }}
38+
39+
- name: Build
40+
uses: actions-rs/cargo@v1
41+
with:
42+
use-cross: true
43+
command: build
44+
args: --target ${{ inputs.target }} ${{ inputs.channel == 'nightly' && '--features=nightly' || '' }}
45+
46+
- name: Test
47+
uses: actions-rs/cargo@v1
48+
with:
49+
use-cross: true
50+
command: test
51+
args: --target ${{ inputs.target }} ${{ inputs.channel == 'nightly' && '--features=nightly' || '' }}
52+

.github/workflows/rust.yml

+37-134
Original file line numberDiff line numberDiff line change
@@ -17,151 +17,54 @@ on:
1717

1818
jobs:
1919
test-software-aes:
20-
runs-on: ubuntu-latest
2120
name: Test of Software Impl on ${{ inputs.target }}
22-
steps:
23-
- uses: actions/checkout@v3
24-
25-
- name: Install Rust
26-
uses: actions-rs/toolchain@v1
27-
with:
28-
toolchain: ${{ inputs.channel }}
29-
target: ${{ inputs.target }}
30-
profile: minimal
31-
components: clippy
32-
override: true
33-
34-
- name: Clippy
35-
uses: actions-rs/cargo@v1
36-
with:
37-
command: clippy
38-
args: --target ${{ inputs.target }}
39-
40-
- name: Build
41-
uses: actions-rs/cargo@v1
42-
with:
43-
use-cross: true
44-
command: build
45-
args: --target ${{ inputs.target }}
46-
47-
- name: Test
48-
uses: actions-rs/cargo@v1
49-
with:
50-
use-cross: true
51-
command: test
52-
args: --target ${{ inputs.target }}
21+
uses: ./.github/workflows/runtest.yml
22+
with:
23+
target: ${{ inputs.target }}
24+
channel: ${{ inputs.channel }}
5325

5426
test-aesni:
5527
# simple test for x86(64)
5628
if: contains(inputs.target, '86')
57-
runs-on: ubuntu-latest
5829
name: Test of AESNI on ${{ inputs.target }}
59-
steps:
60-
- uses: actions/checkout@v3
61-
62-
- name: Install Rust
63-
uses: actions-rs/toolchain@v1
64-
with:
65-
toolchain: ${{ inputs.channel }}
66-
target: ${{ inputs.target }}
67-
profile: minimal
68-
components: clippy
69-
override: true
70-
71-
- run: ${{ format('echo "CROSS_TARGET_{0}_RUSTFLAGS=+sse4.1,+aes"', inputs.target-in-caps) }}
72-
73-
- name: Clippy
74-
uses: actions-rs/cargo@v1
75-
with:
76-
command: clippy
77-
args: --target ${{ inputs.target }}
78-
79-
- name: Build
80-
uses: actions-rs/cargo@v1
81-
with:
82-
use-cross: true
83-
command: build
84-
args: --target ${{ inputs.target }}
85-
86-
- name: Test
87-
uses: actions-rs/cargo@v1
88-
with:
89-
use-cross: true
90-
command: test
91-
args: --target ${{ inputs.target }}
30+
uses: ./.github/workflows/runtest.yml
31+
with:
32+
target: ${{ inputs.target }}
33+
channel: ${{ inputs.channel }}
34+
target-feature: ${{ format('CROSS_TARGET_{0}_RUSTFLAGS=+sse4.1,+aes', inputs.target-in-caps)
9235

9336
test-aesni-vaes:
9437
if: contains(inputs.target, '86') && inputs.channel == 'nightly'
95-
runs-on: ubuntu-latest
9638
name: Test of AESNI with VAES on ${{ inputs.target }}
97-
steps:
98-
- uses: actions/checkout@v3
99-
100-
- name: Install Rust
101-
uses: actions-rs/toolchain@v1
102-
with:
103-
toolchain: ${{ inputs.channel }}
104-
target: ${{ inputs.target }}
105-
profile: minimal
106-
components: clippy
107-
override: true
108-
109-
- run: ${{ format('echo "CROSS_TARGET_{0}_RUSTFLAGS=+vaes"', inputs.target-in-caps) }}
110-
111-
- name: Clippy
112-
uses: actions-rs/cargo@v1
113-
with:
114-
command: clippy
115-
args: --target ${{ inputs.target }} --features=nightly
116-
117-
- name: Build
118-
uses: actions-rs/cargo@v1
119-
with:
120-
use-cross: true
121-
command: build
122-
args: --target ${{ inputs.target }} --features=nightly
123-
124-
- name: Test
125-
uses: actions-rs/cargo@v1
126-
with:
127-
use-cross: true
128-
command: test
129-
args: --target ${{ inputs.target }} --features=nightly
39+
uses: ./.github/workflows/runtest.yml
40+
with:
41+
target: ${{ inputs.target }}
42+
channel: nightly
43+
target-feature: ${{ format('CROSS_TARGET_{0}_RUSTFLAGS=+vaes', inputs.target-in-caps)
13044

13145
test-aesni-vaes-avx512f:
13246
if: contains(inputs.target, '86') && inputs.channel == 'nightly'
133-
runs-on: ubuntu-latest
13447
name: Test of AESNI with VAES and AVX-512 on ${{ inputs.target }}
135-
steps:
136-
- uses: actions/checkout@v3
137-
138-
- name: Install Rust
139-
uses: actions-rs/toolchain@v1
140-
with:
141-
toolchain: ${{ inputs.channel }}
142-
target: ${{ inputs.target }}
143-
profile: minimal
144-
components: clippy
145-
override: true
146-
147-
- run: ${{ format('echo "CROSS_TARGET_{0}_RUSTFLAGS=+vaes,+avx512f"', inputs.target-in-caps) }}
148-
149-
- name: Clippy
150-
uses: actions-rs/cargo@v1
151-
with:
152-
command: clippy
153-
args: --target ${{ inputs.target }} --features=nightly
154-
155-
- name: Build
156-
uses: actions-rs/cargo@v1
157-
with:
158-
use-cross: true
159-
command: build
160-
args: --target ${{ inputs.target }} --features=nightly
161-
162-
- name: Test
163-
uses: actions-rs/cargo@v1
164-
with:
165-
use-cross: true
166-
command: test
167-
args: --target ${{ inputs.target }} --features=nightly
48+
uses: ./.github/workflows/runtest.yml
49+
with:
50+
target: ${{ inputs.target }}
51+
channel: nightly
52+
target-feature: ${{ format('CROSS_TARGET_{0}_RUSTFLAGS=+vaes,+avx512f', inputs.target-in-caps)
53+
54+
test-neon:
55+
if: startsWith(inputs.target, 'aarch64') || startsWith(inputs.target, 'arm64ec') || (startsWith(inputs.target, 'armv8') && inputs.channel == 'nightly')
56+
name: Test of Neon on ${{ inputs.target }}
57+
uses: ./.github/workflows/runtest.yml
58+
with:
59+
target: ${{ inputs.target }}
60+
channel: ${{ inputs.channel }}
61+
target-feature: ${{ format('CROSS_TARGET_{0}_RUSTFLAGS=+aes', inputs.target-in-caps)
62+
63+
test-riscv:
64+
if: startsWith(inputs.target, 'riscv') && inputs.channel == 'nightly'
65+
name: Test of Neon on ${{ inputs.target }}
66+
uses: ./.github/workflows/runtest.yml
67+
with:
68+
target: ${{ inputs.target }}
69+
channel: nightly
70+
target-feature: ${{ format('CROSS_TARGET_{0}_RUSTFLAGS=+zkne,+zknd', inputs.target-in-caps)

0 commit comments

Comments
 (0)