@@ -30,18 +30,6 @@ permissions:
30
30
jobs :
31
31
# This job does our basic build+test for supported platforms.
32
32
test :
33
- env :
34
- # For some builds, we use cross to test on 32-bit and big-endian
35
- # systems.
36
- CARGO : cargo
37
- # When CARGO is set to CROSS, TARGET is set to `--target matrix.target`.
38
- # Note that we only use cross on Linux, so setting a target on a
39
- # different OS will just use normal cargo.
40
- TARGET :
41
- # Bump this as appropriate. We pin to a version to make sure CI
42
- # continues to work as cross releases in the past have broken things
43
- # in subtle ways.
44
- CROSS_VERSION : v0.2.5
45
33
runs-on : ${{ matrix.os }}
46
34
strategy :
47
35
fail-fast : false
50
38
- build : stable
51
39
os : ubuntu-latest
52
40
rust : stable
53
- - build : stable-32
54
- os : ubuntu-latest
55
- rust : stable
56
- target : i686-unknown-linux-gnu
57
- - build : stable-powerpc64
58
- os : ubuntu-latest
59
- rust : stable
60
- target : powerpc64-unknown-linux-gnu
61
- - build : stable-s390x
62
- os : ubuntu-latest
63
- rust : stable
64
- target : s390x-unknown-linux-gnu
65
41
- build : beta
66
42
os : ubuntu-latest
67
43
rust : beta
84
60
uses : dtolnay/rust-toolchain@master
85
61
with :
86
62
toolchain : ${{ matrix.rust }}
63
+ - name : Show CPU info for debugging
64
+ if : matrix.os == 'ubuntu-latest'
65
+ run : lscpu
66
+ - name : Basic build
67
+ run : cargo build --verbose
68
+ - name : Build docs
69
+ run : cargo doc --verbose
70
+ - name : Run subset of tests
71
+ run : cargo test --verbose --test integration
72
+ - name : Build regex-syntax docs
73
+ run : cargo doc --verbose -p regex-syntax
74
+ - name : Run subset of regex-syntax tests
75
+ run : cargo test --verbose -p regex-syntax
76
+ - name : Build regex-automata docs
77
+ run : cargo doc --verbose -p regex-automata
78
+ - name : Run subset of regex-automata tests
79
+ if : matrix.build != 'win-gnu' # Just horrifically slow.
80
+ run : cargo test --verbose -p regex-automata
81
+ - name : Run regex-lite tests
82
+ run : cargo test --verbose -p regex-lite
83
+ - name : Run regex-cli tests
84
+ run : cargo test --verbose -p regex-cli
85
+
86
+ # This job runs tests on cross compiled targets.
87
+ #
88
+ # We used to just have one test and do the same thing on normal targets and
89
+ # cross targets, but cross tests can take an obscenely long time. Especially
90
+ # the doc tests, where each one is compiled individually. (We haven't moved
91
+ # to Rust 2024 yet.)
92
+ cross :
93
+ env :
94
+ # Bump this as appropriate. We pin to a version to make sure CI
95
+ # continues to work as cross releases in the past have broken things
96
+ # in subtle ways.
97
+ CROSS_VERSION : v0.2.5
98
+ runs-on : ${{ matrix.os }}
99
+ strategy :
100
+ fail-fast : false
101
+ matrix :
102
+ target :
103
+ - i686-unknown-linux-gnu
104
+ - aarch64-unknown-linux-gnu
105
+ - powerpc-unknown-linux-gnu
106
+ - powerpc64-unknown-linux-gnu
107
+ - s390x-unknown-linux-gnu
108
+ - x86_64-linux-android
109
+ - aarch64-linux-android
110
+ steps :
111
+ - name : Checkout repository
112
+ uses : actions/checkout@v4
87
113
- name : Install and configure Cross
88
- if : matrix.os == 'ubuntu-latest' && matrix.target != ''
89
114
run : |
90
115
# In the past, new releases of 'cross' have broken CI. So for now, we
91
116
# pin it. We also use their pre-compiled binary releases because cross
@@ -96,34 +121,18 @@ jobs:
96
121
cd "$dir"
97
122
curl -LO "https://github.com/cross-rs/cross/releases/download/$CROSS_VERSION/cross-x86_64-unknown-linux-musl.tar.gz"
98
123
tar xf cross-x86_64-unknown-linux-musl.tar.gz
99
- echo "CARGO=cross" >> $GITHUB_ENV
100
- echo "TARGET=--target ${{ matrix.target }}" >> $GITHUB_ENV
101
- - name : Show command used for Cargo
102
- run : |
103
- echo "cargo command is: $CARGO"
104
- echo "target flag is: $TARGET"
105
- - name : Show CPU info for debugging
106
- if : matrix.os == 'ubuntu-latest'
107
- run : lscpu
108
124
- name : Basic build
109
- run : ${{ env.CARGO }} build --verbose $TARGET
110
- - name : Build docs
111
- run : ${{ env.CARGO }} doc --verbose $TARGET
125
+ run : cross build --all --verbose --target ${{ matrix.target }}
112
126
- name : Run subset of tests
113
- run : ${{ env.CARGO }} test --verbose --test integration $TARGET
114
- - name : Build regex-syntax docs
115
- run : ${{ env.CARGO }} doc --verbose --manifest-path regex-syntax/Cargo.toml $TARGET
127
+ run : ${{ env.CARGO }} test --verbose --test integration --target ${{ matrix.target }}
116
128
- name : Run subset of regex-syntax tests
117
- run : ${{ env.CARGO }} test --verbose --manifest-path regex-syntax/Cargo.toml $TARGET
118
- - name : Build regex-automata docs
119
- run : ${{ env.CARGO }} doc --verbose --manifest-path regex-automata/Cargo.toml $TARGET
129
+ run : ${{ env.CARGO }} test --verbose -p regex-syntax --lib --target ${{ matrix.target }}
120
130
- name : Run subset of regex-automata tests
121
- if : matrix.build != 'win-gnu' # Just horrifically slow.
122
- run : ${{ env.CARGO }} test --verbose --manifest-path regex-automata/Cargo.toml $TARGET
131
+ run : ${{ env.CARGO }} test --verbose -p regex-automata --lib --target ${{ matrix.target }}
123
132
- name : Run regex-lite tests
124
- run : ${{ env.CARGO }} test --verbose --manifest-path regex-lite/Cargo.toml $TARGET
133
+ run : ${{ env.CARGO }} test --verbose -p regex-lite --lib --target ${{ matrix.target }}
125
134
- name : Run regex-cli tests
126
- run : ${{ env.CARGO }} test --verbose --manifest-path regex-cli/Cargo.toml $TARGET
135
+ run : ${{ env.CARGO }} test --verbose -p regex-cli --lib --target ${{ matrix.target }}
127
136
128
137
# This job runs a stripped down version of CI to test the MSRV. The specific
129
138
# reason for doing this is that the regex crate's dev-dependencies tend to
@@ -222,7 +231,7 @@ jobs:
222
231
toolchain : nightly
223
232
components : miri
224
233
- name : Run full test suite
225
- run : cargo miri test --manifest-path regex-automata/Cargo.toml
234
+ run : cargo miri test -p regex-automata
226
235
227
236
# Tests that everything is formatted correctly.
228
237
rustfmt :
0 commit comments