@@ -16,18 +16,28 @@ jobs:
1616 target :
1717 - os : ubuntu-latest
1818 target : x86_64-unknown-linux-gnu
19+ test : true
20+ cross : false
1921 - os : ubuntu-latest
2022 target : aarch64-unknown-linux-gnu
23+ test : true
2124 cross : true
2225 - os : macos-latest
2326 target : x86_64-apple-darwin
27+ test : true
28+ cross : false
2429 - os : macos-latest
2530 target : aarch64-apple-darwin
31+ test : true
32+ cross : false
2633 - os : windows-latest
2734 target : x86_64-pc-windows-msvc
35+ test : true
36+ cross : false
2837 - os : windows-latest
2938 target : aarch64-pc-windows-msvc
3039 test : false # cross-compilation is not required, but we can't test it natively
40+ cross : false
3141 feature : [cli, server]
3242 steps :
3343 - uses : actions/checkout@v4
@@ -42,30 +52,24 @@ jobs:
4252
4353 - name : Install cross
4454 if : matrix.target.cross
45- run : |
46- cargo install cross --git https://github.com/cross-rs/cross
47-
48- - name : Install macOS dependencies
49- if : matrix.target.os == 'macos-latest'
50- run : |
51- brew install pkg-config openssl@3
55+ run : cargo install cross --git https://github.com/cross-rs/cross
5256
5357 - name : Build project (native)
54- if : ${{ ! matrix.target.cross }} # default to false if not set
58+ if : ${{ matrix.target.cross == false }}
5559 run : cargo build --target ${{ matrix.target.target }} --features ${{ matrix.feature }}
5660
5761 - name : Build project (cross-compilation)
58- if : matrix.target.cross
62+ if : ${{ matrix.target.cross == true }}
5963 run : cross build --release --target=${{ matrix.target.target }} --features ${{ matrix.feature }},vendored-openssl
6064
6165 - name : Install nextest
62- if : ${{ ! matrix.target.cross }} # default to false if not set
66+ if : ${{ matrix.target.test != false }}
6367 uses : taiki-e/install-action@nextest
6468
6569 - name : Run tests (native)
66- if : ( matrix.target.cross != true) && ( matrix.target.test != false)
70+ if : ${{ matrix.target.test == true && matrix.target.cross == false }}
6771 run : cargo nextest run --verbose --features ${{ matrix.feature }} --target ${{ matrix.target.target }}
6872
6973 - name : Run tests (cross-compiled)
70- if : matrix.target.cross && ( matrix.target.test != false)
71- run : cargo nextest run --verbose --features ${{ matrix.feature }} --target ${{ matrix.target.target }}
74+ if : ${{ matrix.target.test == true && matrix.target.cross == true }}
75+ run : cross test --verbose --features ${{ matrix.feature }} --target ${{ matrix.target.target }}
0 commit comments