Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port banches to criterion and test benches in CI #352

Merged
merged 5 commits into from
Aug 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
join all CI jobs and test benches
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
sagudev committed Aug 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit db9ca3bfd42430bd6cd1185bf62de2f8d6d0f3e1
89 changes: 27 additions & 62 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -7,89 +7,55 @@ 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

- name: rustfmt
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
sagudev marked this conversation as resolved.
Show resolved Hide resolved
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')