|
13 | 13 | strategy: |
14 | 14 | fail-fast: false |
15 | 15 | matrix: |
| 16 | + test: [true] |
| 17 | + cross: [false] |
16 | 18 | target: |
17 | 19 | - os: ubuntu-latest |
18 | 20 | target: x86_64-unknown-linux-gnu |
@@ -42,30 +44,24 @@ jobs: |
42 | 44 |
|
43 | 45 | - name: Install cross |
44 | 46 | 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 |
| 47 | + run: cargo install cross --git https://github.com/cross-rs/cross |
52 | 48 |
|
53 | 49 | - name: Build project (native) |
54 | | - if: ${{ !matrix.target.cross }} # default to false if not set |
| 50 | + if: ${{ !matrix.target.cross }} |
55 | 51 | run: cargo build --target ${{ matrix.target.target }} --features ${{ matrix.feature }} |
56 | 52 |
|
57 | 53 | - name: Build project (cross-compilation) |
58 | 54 | if: matrix.target.cross |
59 | 55 | run: cross build --release --target=${{ matrix.target.target }} --features ${{ matrix.feature }},vendored-openssl |
60 | 56 |
|
61 | 57 | - name: Install nextest |
62 | | - if: ${{ !matrix.target.cross }} # default to false if not set |
| 58 | + if: ${{ matrix.target.test != false }} |
63 | 59 | uses: taiki-e/install-action@nextest |
64 | 60 |
|
65 | 61 | - name: Run tests (native) |
66 | | - if: (matrix.target.cross != true) && (matrix.target.test != false) |
| 62 | + if: ${{ matrix.target.test != false && !matrix.target.cross }} |
67 | 63 | run: cargo nextest run --verbose --features ${{ matrix.feature }} --target ${{ matrix.target.target }} |
68 | 64 |
|
69 | 65 | - 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 }} |
| 66 | + if: ${{ matrix.target.test != false && matrix.target.cross }} |
| 67 | + run: cross test --verbose --features ${{ matrix.feature }} --target ${{ matrix.target.target }} |
0 commit comments