From 1c3d39677a3f40c06b2cd70f32586e7695698dc2 Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Wed, 24 Aug 2022 09:15:07 +0200 Subject: [PATCH 1/2] Split checking and testing to a bit more parallelism in the CI. --- .github/workflows/coverage.yml | 2 +- .github/workflows/long_running.yml | 3 +- .github/workflows/test.yml | 49 +++++++++++++++++++----------- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f70d3e04e..4ac3a041c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install Rust - run: rustup toolchain install nightly --component llvm-tools-preview + run: rustup toolchain install nightly --profile minimal --component llvm-tools-preview - uses: Swatinem/rust-cache@v2 - uses: taiki-e/install-action@cargo-llvm-cov - name: Generate code coverage diff --git a/.github/workflows/long_running.yml b/.github/workflows/long_running.yml index c0de14921..b937f7b41 100644 --- a/.github/workflows/long_running.yml +++ b/.github/workflows/long_running.yml @@ -19,11 +19,10 @@ jobs: uses: actions-rs/toolchain@v1 with: toolchain: stable + profile: minimal override: true - components: rustfmt, clippy - name: Run indexing_unsorted run: cargo test indexing_unsorted -- --ignored - name: Run indexing_sorted run: cargo test indexing_sorted -- --ignored - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ffe69e204..177834b99 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,25 +10,50 @@ env: CARGO_TERM_COLOR: always jobs: + check: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install nightly + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + profile: minimal + components: rustfmt + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: clippy + + - uses: Swatinem/rust-cache@v2 + + - name: Check Formatting + run: cargo +nightly fmt --all -- --check + + - uses: actions-rs/clippy-check@v1 + with: + toolchain: stable + token: ${{ secrets.GITHUB_TOKEN }} + args: --tests + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Install latest nightly to test also against unstable feature flag - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - override: true - components: rustfmt - name: Install stable uses: actions-rs/toolchain@v1 with: toolchain: stable + profile: minimal override: true - components: rustfmt, clippy - uses: taiki-e/install-action@nextest - uses: Swatinem/rust-cache@v2 @@ -47,13 +72,3 @@ jobs: - name: Run doctests quickwit feature run: cargo +stable test --doc --features mmap,quickwit,failpoints --verbose --workspace - - - name: Check Formatting - run: cargo +nightly fmt --all -- --check - - - uses: actions-rs/clippy-check@v1 - with: - toolchain: stable - token: ${{ secrets.GITHUB_TOKEN }} - args: --tests - From 11a4d97cf50dc827f87d58cd783ecafc2864b1cd Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Wed, 24 Aug 2022 09:59:50 +0200 Subject: [PATCH 2/2] Use a job matrix to further split and deduplicate the test CI job. --- .github/workflows/test.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 177834b99..434a3bf3a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,6 +45,15 @@ jobs: runs-on: ubuntu-latest + strategy: + matrix: + features: [ + { label: "all", flags: "mmap,brotli-compression,lz4-compression,snappy-compression,zstd-compression,failpoints" }, + { label: "quickwit", flags: "mmap,quickwit,failpoints" } + ] + + name: test-${{ matrix.features.label}} + steps: - uses: actions/checkout@v3 @@ -58,17 +67,8 @@ jobs: - uses: taiki-e/install-action@nextest - uses: Swatinem/rust-cache@v2 - - name: Build - run: cargo build --verbose --workspace - - name: Run tests - run: cargo +stable nextest run --features mmap,brotli-compression,lz4-compression,snappy-compression,zstd-compression,failpoints --verbose --workspace + run: cargo +stable nextest run --features ${{ matrix.features.flags }} --verbose --workspace - name: Run doctests - run: cargo +stable test --doc --features mmap,brotli-compression,lz4-compression,snappy-compression,zstd-compression,failpoints --verbose --workspace - - - name: Run tests quickwit feature - run: cargo +stable nextest run --features mmap,quickwit,failpoints --verbose --workspace - - - name: Run doctests quickwit feature - run: cargo +stable test --doc --features mmap,quickwit,failpoints --verbose --workspace + run: cargo +stable test --doc --features ${{ matrix.features.flags }} --verbose --workspace