Skip to content

Commit 3687959

Browse files
committed
Add CI for a 32-bit target and with/without SSE4.2
1 parent da5da2b commit 3687959

File tree

2 files changed

+100
-22
lines changed

2 files changed

+100
-22
lines changed

.github/actions/test/action.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Run tests
2+
3+
inputs:
4+
toolchain:
5+
default: "stable"
6+
required: false
7+
type: string
8+
9+
features:
10+
default: ""
11+
required: false
12+
type: string
13+
14+
rustflags:
15+
default: ""
16+
required: false
17+
type: string
18+
19+
target:
20+
default: ""
21+
required: false
22+
type: string
23+
24+
runs:
25+
using: "composite"
26+
steps:
27+
- name: Install Rust
28+
uses: actions-rs/toolchain@v1
29+
with:
30+
toolchain: ${{ inputs.toolchain }}
31+
profile: minimal
32+
default: true
33+
34+
- name: Configure cross
35+
shell: bash
36+
run: |
37+
cat > Cross.toml <<EOF
38+
[build.env]
39+
passthrough = ["RUSTFLAGS", "RUSTDOCFLAGS"]
40+
EOF
41+
42+
- name: Run tests
43+
uses: actions-rs/cargo@v1
44+
env:
45+
RUSTFLAGS: "${{ env.RUSTFLAGS }} ${{ inputs.rustflags }}"
46+
with:
47+
command: test
48+
args: >-
49+
--all
50+
${{ inputs.features != '' && format('--features {0}', inputs.features) || '' }}
51+
${{ inputs.target != '' && format('--target {0}', inputs.target) || '' }}
52+
use-cross: ${{ inputs.target != '' }}

.github/workflows/ci.yml

Lines changed: 48 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,65 @@ env:
66
RUSTDOCFLAGS: -D warnings
77

88
jobs:
9-
primary:
9+
toolchains:
1010
strategy:
1111
matrix:
12-
os: [ubuntu-latest]
13-
toolchain: [stable, beta, nightly]
14-
features: ['']
12+
toolchain: ["stable", "beta", "nightly"]
1513

16-
include:
17-
- os: ubuntu-latest
18-
toolchain: nightly
19-
features: pattern
14+
runs-on: ubuntu-latest
2015

21-
- os: windows-latest
22-
toolchain: stable
16+
steps:
17+
- name: Check out code
18+
uses: actions/checkout@v3
19+
20+
- name: Run tests
21+
uses: ./.github/actions/test
22+
with:
23+
toolchain: "${{ matrix.toolchain }}"
24+
25+
platforms:
26+
strategy:
27+
matrix:
28+
platform: ["windows-latest", "macos-latest"]
29+
30+
runs-on: ${{ matrix.platform }}
31+
32+
steps:
33+
- name: Check out code
34+
uses: actions/checkout@v3
2335

24-
- os: macos-latest
25-
toolchain: stable
36+
- name: Run tests
37+
uses: ./.github/actions/test
38+
with:
39+
platform: "${{ matrix.platform }}"
2640

27-
runs-on: ${{ matrix.os }}
41+
crate_features:
42+
runs-on: ubuntu-latest
2843

2944
steps:
3045
- name: Check out code
31-
uses: actions/checkout@v2
46+
uses: actions/checkout@v3
3247

33-
- name: Install Rust
34-
uses: actions-rs/toolchain@v1
48+
- name: Run tests
49+
uses: ./.github/actions/test
3550
with:
36-
toolchain: ${{ matrix.toolchain }}
37-
profile: minimal
38-
default: true
51+
toolchain: "nightly"
52+
features: "pattern"
53+
54+
target_features:
55+
strategy:
56+
matrix:
57+
target_feature: ["-sse4.2", "+sse4.2"]
58+
target: ["", "i686-unknown-linux-gnu"]
59+
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: Check out code
64+
uses: actions/checkout@v3
3965

4066
- name: Run tests
41-
uses: actions-rs/cargo@v1
67+
uses: ./.github/actions/test
4268
with:
43-
command: test
44-
args: --all --features=${{ matrix.features }}
69+
rustflags: "-C target-feature=${{ matrix.target_feature }}"
70+
target: "${{ matrix.target }}"

0 commit comments

Comments
 (0)