From db9ca3bfd42430bd6cd1185bf62de2f8d6d0f3e1 Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Sun, 18 Aug 2024 17:52:54 +0200 Subject: [PATCH] join all CI jobs and test benches Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --- .github/workflows/main.yml | 89 ++++++++++++-------------------------- 1 file changed, 27 insertions(+), 62 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fc818da8..91c6d0cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,19 +7,34 @@ on: workflow_dispatch: merge_group: types: [checks_requested] - + jobs: - linux-ci: - name: Linux - runs-on: ubuntu-latest + test: + name: ${{ format('{0} {1}', matrix.platform.target, matrix.features)}} + runs-on: ${{ matrix.platform.os }} + env: + RUST_BACKTRACE: 1 strategy: matrix: - features: ["", "force-inprocess", "memfd", "async"] + platform: + - { target: aarch64-apple-darwin, os: macos-14 } + - { target: x86_64-apple-darwin, os: macos-13 } + - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest } + - { target: x86_64-pc-windows-msvc, os: windows-latest } + - { target: i686-pc-windows-msvc, os: windows-latest } + features: ["", "force-inprocess", "async"] + include: + - features: "windows-shared-memory-equality" + platform: { target: x86_64-pc-windows-msvc, os: windows-latest } + - features: "windows-shared-memory-equality" + platform: { target: i686-pc-windows-msvc, os: windows-latest } + - features: "memfd" + platform: { target: x86_64-unknown-linux-gnu, os: ubuntu-latest } steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Install nightly toolchain - uses: dtolnay/rust-toolchain@nightly + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable with: components: rustfmt, clippy @@ -27,69 +42,20 @@ jobs: run: cargo fmt --check - name: clippy - run: cargo clippy --features "${{ matrix.features }}" - - - name: Cargo build - run: cargo build --features "${{ matrix.features }}" + run: cargo clippy --features "${{ matrix.features }}" --target ${{ matrix.platform.target }} - name: Cargo test - run: cargo test --features "${{ matrix.features }}" - env: - RUST_BACKTRACE: 1 - - mac-ci: - name: macOS - runs-on: macos-latest - strategy: - matrix: - features: ["", "force-inprocess", "async"] - - steps: - - uses: actions/checkout@v3 - - - name: Install nightly toolchain - uses: dtolnay/rust-toolchain@nightly - - - name: Cargo build - run: cargo build --features "${{ matrix.features }}" + run: cargo test --features "${{ matrix.features }}" --target ${{ matrix.platform.target }} - name: Cargo test - run: cargo test --features "${{ matrix.features }}" - env: - RUST_BACKTRACE: 1 - - windows-ci: - name: Windows - runs-on: windows-latest - strategy: - matrix: - features: ["", "--features force-inprocess", "--features windows-shared-memory-equality", "--features async"] - target: ["x86_64-pc-windows-msvc", "i686-pc-windows-msvc"] - - steps: - - uses: actions/checkout@v3 - - - name: Install nightly toolchain - uses: dtolnay/rust-toolchain@nightly - with: - targets: ${{ matrix.target }} - - - name: Cargo build - run: cargo build ${{ matrix.features }} --target ${{ matrix.target }} - - - name: Cargo test - run: cargo test ${{ matrix.features }} --target ${{ matrix.target }} - env: - RUST_BACKTRACE: 1 + run: cargo test --benches --features "${{ matrix.features }}" --target ${{ matrix.platform.target }} build_result: name: Result runs-on: ubuntu-latest if: always() needs: - - "linux-ci" - - "mac-ci" - - "windows-ci" + - "test" steps: - name: Success @@ -98,4 +64,3 @@ jobs: - name: Failure run: exit 1 if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') -