Skip to content

Commit

Permalink
Split up workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
h33p committed Oct 30, 2023
1 parent 4faa599 commit dea2542
Show file tree
Hide file tree
Showing 6 changed files with 217 additions and 140 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/asan.yml
Original file line number Diff line number Diff line change
@@ -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: ["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
- name: Run all tests
run: cargo test --verbose --target ${{ steps.target.outputs.RUSTC_TARGET }}
140 changes: 0 additions & 140 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ env:
CARGO_NET_GIT_FETCH_WITH_CLI: true

jobs:

build-base:
runs-on: ${{ matrix.os }}
env:
Expand Down Expand Up @@ -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 }};
33 changes: 33 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -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 }};
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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 }}
28 changes: 28 additions & 0 deletions .github/workflows/miri.yml
Original file line number Diff line number Diff line change
@@ -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
58 changes: 58 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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

- run: sudo apt update && sudo apt install libc-bin
if: matrix.os == 'ubuntu-latest'
- 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

- run: sudo apt update && sudo apt install libc-bin
if: matrix.os == 'ubuntu-latest'
- name: Run all tests
run: cargo test --workspace --all-features --verbose


0 comments on commit dea2542

Please sign in to comment.