diff --git a/.github/workflows/asan.yml b/.github/workflows/asan.yml new file mode 100644 index 0000000..49fd1c5 --- /dev/null +++ b/.github/workflows/asan.yml @@ -0,0 +1,70 @@ +name: Build and test + +on: [push, pull_request] + +env: + CARGO_TERM_COLOR: always + CARGO_NET_GIT_FETCH_WITH_CLI: true + +jobs: + test-asan: + runs-on: ${{ matrix.os }} + env: + RUSTFLAGS: -Zsanitizer=address -C debuginfo=2 ${{ matrix.rustflags }} + RUSTDOCFLAGS: -Zsanitizer=address -C debuginfo=2 ${{ matrix.rustflags }} + CARGO_BUILD_RUSTFLAGS: -C debuginfo=2 + ASAN_OPTIONS: symbolize=1 detect_leaks=0 + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + # TODO: enable windows, macos + os: [ubuntu-latest] + toolchain: ["nightly-2023-09-01"] + rustflags: ["--cfg mfio_assume_linear_types --cfg tokio_unstable", "--cfg tokio_unstable"] + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + override: true + + - name: Get rustc target + run: | + echo "RUSTC_TARGET=$(rustc -vV | sed -n 's|host: ||p')" >> $GITHUB_OUTPUT + id: target + - name: Install llvm + run: sudo apt update && sudo apt install llvm-13 + - run: rustup component add rust-src + - name: Run all tests + run: cargo -Zbuild-std test --verbose --target ${{ steps.target.outputs.RUSTC_TARGET }} + + test-asan-lite: + runs-on: ${{ matrix.os }} + env: + RUSTFLAGS: -Zsanitizer=address ${{ matrix.rustflags }} + RUSTDOCFLAGS: -Zsanitizer=address ${{ matrix.rustflags }} + ASAN_OPTIONS: symbolize=1 detect_leaks=0 + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + # TODO: enable windows, macos + os: [ubuntu-latest] + toolchain: ["stable", "1.72"] + rustflags: ["--cfg mfio_assume_linear_types --cfg tokio_unstable", "--cfg tokio_unstable"] + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + override: true + + - name: Get rustc target + run: | + echo "RUSTC_TARGET=$(rustc -vV | sed -n 's|host: ||p')" >> $GITHUB_OUTPUT + id: target + - name: Install llvm + run: sudo apt update && sudo apt install llvm-13 + - name: Run all tests + run: cargo test --verbose --target ${{ steps.target.outputs.RUSTC_TARGET }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b75e3d2..70c4f91 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,6 @@ env: CARGO_NET_GIT_FETCH_WITH_CLI: true jobs: - build-base: runs-on: ${{ matrix.os }} env: @@ -72,142 +71,3 @@ jobs: use-cross: true command: build args: --target aarch64-unknown-linux-gnu --verbose - - test: - runs-on: ${{ matrix.os }} - env: - RUSTFLAGS: ${{ matrix.rustflags }} - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - toolchain: ["1.72", "stable"] - rustflags: ["--cfg mfio_assume_linear_types --cfg tokio_unstable", "--cfg tokio_unstable"] - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - - name: Run all tests - run: cargo test --verbose - - test-all-features: - runs-on: ${{ matrix.os }} - env: - RUSTFLAGS: ${{ matrix.rustflags }} - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - toolchain: ["1.72", "stable", "nightly-2023-09-01"] - rustflags: ["--cfg mfio_assume_linear_types --cfg tokio_unstable", "--cfg tokio_unstable"] - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - - name: Run all tests - run: cargo test --workspace --all-features --verbose - - test-asan: - runs-on: ${{ matrix.os }} - env: - RUSTFLAGS: -Zsanitizer=address -C debuginfo=2 ${{ matrix.rustflags }} - RUSTDOCFLAGS: -Zsanitizer=address -C debuginfo=2 ${{ matrix.rustflags }} - CARGO_BUILD_RUSTFLAGS: -C debuginfo=2 - ASAN_OPTIONS: symbolize=1 detect_leaks=0 - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - # TODO: enable windows, macos - os: [ubuntu-latest] - toolchain: ["nightly-2023-09-01"] - rustflags: ["--cfg mfio_assume_linear_types --cfg tokio_unstable", "--cfg tokio_unstable"] - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - - name: Get rustc target - run: | - echo "RUSTC_TARGET=$(rustc -vV | sed -n 's|host: ||p')" >> $GITHUB_OUTPUT - id: target - - name: Install llvm - run: sudo apt update && sudo apt install llvm-13 - - run: rustup component add rust-src - - name: Run all tests - run: cargo -Zbuild-std test --verbose --target ${{ steps.target.outputs.RUSTC_TARGET }} - - lint: - runs-on: ${{ matrix.os }} - env: - RUSTFLAGS: ${{ matrix.rustflags }} - strategy: - fail-fast: false - matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - features: ["--all-features", ""] - rustflags: ["--cfg mfio_assume_linear_types --cfg tokio_unstable", "--cfg tokio_unstable"] - steps: - - uses: actions/checkout@v2 - - run: rustup component add clippy - - name: Check formatting - run: cargo fmt -- --check - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-targets ${{ matrix.features }} - - miri: - runs-on: ubuntu-latest - env: - RUSTFLAGS: ${{ matrix.rustflags }} - strategy: - matrix: - toolchain: ["nightly-2023-09-01"] - seed: [1, 2, 3, 4, 5, 6, 7, 8] - rustflags: ["--cfg mfio_assume_linear_types --cfg tokio_unstable", "--cfg tokio_unstable"] - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - run: rustup component add miri - - name: Run miri - run: | - MIRIFLAGS="-Zmiri-seed=${{ matrix.seed }} -Zmiri-ignore-leaks -Zmiri-symbolic-alignment-check -Zmiri-retag-fields=all -Zmiri-symbolic-alignment-check -Zmiri-strict-provenance -Zmiri-disable-isolation -Zmiri-tree-borrows" cargo miri test - - build-coverage: - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/checkout@v2 - with: - path: 'mfio-repo' - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2023-09-01 - override: true - - run: cargo install grcov - - name: Run tests with coverage - run: | - cd mfio-repo - export CARGO_INCREMENTAL=0 - export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" - export RUSTDOCFLAGS="-Cpanic=abort" - cargo build --workspace --exclude mfio-derive --all-features - cargo test --workspace --exclude mfio-derive --all-features - grcov ./target/debug/ -s . -t lcov --llvm --branch --ignore-not-existing -o ./target/debug/coverage - bash <(curl -s https://codecov.io/bash) -f ./target/debug/coverage -t ${{ secrets.CODECOV_TOKEN }}; - diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..31a8d5b --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,33 @@ +name: Build and test + +on: [push, pull_request] + +env: + CARGO_TERM_COLOR: always + CARGO_NET_GIT_FETCH_WITH_CLI: true + +jobs: + build-coverage: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/checkout@v2 + with: + path: 'mfio-repo' + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2023-09-01 + override: true + - run: cargo install grcov + - name: Run tests with coverage + run: | + cd mfio-repo + export CARGO_INCREMENTAL=0 + export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" + export RUSTDOCFLAGS="-Cpanic=abort" + cargo build --workspace --exclude mfio-derive --all-features + cargo test --workspace --exclude mfio-derive --all-features + grcov ./target/debug/ -s . -t lcov --llvm --branch --ignore-not-existing -o ./target/debug/coverage + bash <(curl -s https://codecov.io/bash) -f ./target/debug/coverage -t ${{ secrets.CODECOV_TOKEN }}; + diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..9b3c845 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,28 @@ +name: Build and test + +on: [push, pull_request] + +env: + CARGO_TERM_COLOR: always + CARGO_NET_GIT_FETCH_WITH_CLI: true + +jobs: + lint: + runs-on: ${{ matrix.os }} + env: + RUSTFLAGS: ${{ matrix.rustflags }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + features: ["--all-features", ""] + rustflags: ["--cfg mfio_assume_linear_types --cfg tokio_unstable", "--cfg tokio_unstable"] + steps: + - uses: actions/checkout@v2 + - run: rustup component add clippy + - name: Check formatting + run: cargo fmt -- --check + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-targets ${{ matrix.features }} diff --git a/.github/workflows/miri.yml b/.github/workflows/miri.yml new file mode 100644 index 0000000..98479aa --- /dev/null +++ b/.github/workflows/miri.yml @@ -0,0 +1,28 @@ +name: Build and test + +on: [push, pull_request] + +env: + CARGO_TERM_COLOR: always + CARGO_NET_GIT_FETCH_WITH_CLI: true + +jobs: + miri: + runs-on: ubuntu-latest + env: + RUSTFLAGS: ${{ matrix.rustflags }} + strategy: + matrix: + toolchain: ["nightly-2023-09-01"] + seed: [1, 2, 3, 4, 5, 6, 7, 8] + rustflags: ["--cfg mfio_assume_linear_types --cfg tokio_unstable", "--cfg tokio_unstable"] + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + override: true + - run: rustup component add miri + - name: Run miri + run: | + MIRIFLAGS="-Zmiri-seed=${{ matrix.seed }} -Zmiri-ignore-leaks -Zmiri-symbolic-alignment-check -Zmiri-retag-fields=all -Zmiri-symbolic-alignment-check -Zmiri-strict-provenance -Zmiri-disable-isolation -Zmiri-tree-borrows" cargo miri test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f21fa1a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,54 @@ +name: Build and test + +on: [push, pull_request] + +env: + CARGO_TERM_COLOR: always + CARGO_NET_GIT_FETCH_WITH_CLI: true + CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: catchsegv + +jobs: + + test: + runs-on: ${{ matrix.os }} + env: + RUSTFLAGS: ${{ matrix.rustflags }} + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + toolchain: ["1.72", "stable"] + rustflags: ["--cfg mfio_assume_linear_types --cfg tokio_unstable", "--cfg tokio_unstable"] + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + override: true + + - name: Run all tests + run: cargo test --verbose + + test-all-features: + runs-on: ${{ matrix.os }} + env: + RUSTFLAGS: ${{ matrix.rustflags }} + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + toolchain: ["1.72", "stable", "nightly-2023-09-01"] + rustflags: ["--cfg mfio_assume_linear_types --cfg tokio_unstable", "--cfg tokio_unstable"] + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + override: true + + - name: Run all tests + run: cargo test --workspace --all-features --verbose + +