3131 # This job does our basic build+test for supported platforms.
3232 test :
3333 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
4534 runs-on : ${{ matrix.os }}
4635 strategy :
4736 fail-fast : false
5039 - build : stable
5140 os : ubuntu-latest
5241 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
6542 - build : beta
6643 os : ubuntu-latest
6744 rust : beta
8461 uses : dtolnay/rust-toolchain@master
8562 with :
8663 toolchain : ${{ matrix.rust }}
64+ - name : Show CPU info for debugging
65+ if : matrix.os == 'ubuntu-latest'
66+ run : lscpu
67+ - name : Basic build
68+ run : cargo build --verbose
69+ - name : Build docs
70+ run : cargo doc --verbose
71+ - name : Run subset of tests
72+ run : cargo test --verbose --test integration
73+ - name : Build regex-syntax docs
74+ run : cargo doc --verbose -p regex-syntax
75+ - name : Run subset of regex-syntax tests
76+ run : cargo test --verbose -p regex-syntax
77+ - name : Build regex-automata docs
78+ run : cargo doc --verbose -p regex-automata
79+ - name : Run subset of regex-automata tests
80+ if : matrix.build != 'win-gnu' # Just horrifically slow.
81+ run : cargo test --verbose -p regex-automata
82+ - name : Run regex-lite tests
83+ run : cargo test --verbose -p regex-lite
84+ - name : Run regex-cli tests
85+ run : cargo test --verbose -p regex-cli
86+
87+ # This job runs tests on cross compiled targets.
88+ #
89+ # We used to just have one test and do the same thing on normal targets and
90+ # cross targets, but cross tests can take an obscenely long time. Especially
91+ # the doc tests, where each one is compiled individually. (We haven't moved
92+ # to Rust 2024 yet.)
93+ cross :
94+ env :
95+ # Bump this as appropriate. We pin to a version to make sure CI
96+ # continues to work as cross releases in the past have broken things
97+ # in subtle ways.
98+ CROSS_VERSION : v0.2.5
99+ runs-on : ${{ matrix.os }}
100+ strategy :
101+ fail-fast : false
102+ matrix :
103+ target :
104+ include :
105+ - i686-unknown-linux-gnu
106+ - aarch64-unknown-linux-gnu
107+ - powerpc-unknown-linux-gnu
108+ - powerpc64-unknown-linux-gnu
109+ - s390x-unknown-linux-gnu
110+ - x86_64-linux-android
111+ - aarch64-linux-android
112+ steps :
113+ - name : Checkout repository
114+ uses : actions/checkout@v4
87115 - name : Install and configure Cross
88- if : matrix.os == 'ubuntu-latest' && matrix.target != ''
89116 run : |
90117 # In the past, new releases of 'cross' have broken CI. So for now, we
91118 # pin it. We also use their pre-compiled binary releases because cross
@@ -96,34 +123,18 @@ jobs:
96123 cd "$dir"
97124 curl -LO "https://github.com/cross-rs/cross/releases/download/$CROSS_VERSION/cross-x86_64-unknown-linux-musl.tar.gz"
98125 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
108126 - name : Basic build
109- run : ${{ env.CARGO }} build --verbose $TARGET
110- - name : Build docs
111- run : ${{ env.CARGO }} doc --verbose $TARGET
127+ run : cross build --all --verbose --target ${{ matrix.target }}
112128 - 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
129+ run : ${{ env.CARGO }} test --verbose --test integration --target ${{ matrix.target }}
116130 - 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
131+ run : ${{ env.CARGO }} test --verbose -p regex-syntax --lib --target ${{ matrix.target }}
120132 - 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
133+ run : ${{ env.CARGO }} test --verbose -p regex-automata --lib --target ${{ matrix.target }}
123134 - name : Run regex-lite tests
124- run : ${{ env.CARGO }} test --verbose --manifest-path regex-lite/Cargo.toml $TARGET
135+ run : ${{ env.CARGO }} test --verbose -p regex-lite --lib --target ${{ matrix.target }}
125136 - name : Run regex-cli tests
126- run : ${{ env.CARGO }} test --verbose --manifest-path regex-cli/Cargo.toml $TARGET
137+ run : ${{ env.CARGO }} test --verbose -p regex-cli --lib --target ${{ matrix.target }}
127138
128139 # This job runs a stripped down version of CI to test the MSRV. The specific
129140 # reason for doing this is that the regex crate's dev-dependencies tend to
@@ -222,7 +233,7 @@ jobs:
222233 toolchain : nightly
223234 components : miri
224235 - name : Run full test suite
225- run : cargo miri test --manifest-path regex-automata/Cargo.toml
236+ run : cargo miri test -p regex-automata
226237
227238 # Tests that everything is formatted correctly.
228239 rustfmt :
0 commit comments