From dddcb51b95dbb51f1b73953fd642df99f7453fdd Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 3 Jan 2025 17:44:55 +1100 Subject: [PATCH] Optimize CI Parameterize cargo flags into matrix for parallel building and better caching --- .github/workflows/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79d7d598f..eb42699ba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,6 +31,7 @@ jobs: mingw64, windows-2019, ] + cargo_flags: ['', '--release', '--features parallel'] include: - build: stable os: ubuntu-latest @@ -135,9 +136,7 @@ jobs: if: startsWith(matrix.build, 'windows-clang') - run: cargo update - uses: Swatinem/rust-cache@v2 - - run: cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} - - run: cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --release - - run: cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --features parallel + - run: cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} ${{ matrix.cargo_flags }} # This is separate from the matrix above because there is no prebuilt rust-std component for these targets. check-tvos: