CI: run valgrind tests without SSE2 enabled #99
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/rust.yml' | |
- 'src/**.rs' | |
- 'tests/**' | |
- 'Cargo.toml' | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
branches: | |
- '**' | |
paths: | |
- '.github/workflows/rust.yml' | |
- 'src/**.rs' | |
- 'tests/**' | |
- 'Cargo.toml' | |
jobs: | |
full-test: | |
runs-on: ${{ matrix.os }} | |
if: github.event.pull_request.draft == false | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install Rust Unix | |
run: | | |
if rustup --version >/dev/null 2>&1; then | |
rustup update | |
else | |
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable | |
echo ::add-path::$HOME/.cargo/bin | |
fi | |
- name: Install Valgrind | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y valgrind | |
- name: Rust version | |
run: | | |
cargo --version | |
rustc --version | |
- name: Check build | |
run: cargo check --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3 | |
- name: Test | |
run: cargo test --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3 | |
- name: Valgrind Test | |
env: | |
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: "valgrind --leak-check=full --error-exitcode=1" | |
run: cargo test --release --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3 | |
- name: Valgrind Test(No SSE2) | |
env: | |
RUSTFLAGS: "-Ctarget-feature=-sse2" | |
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: "valgrind --leak-check=full --error-exitcode=1" | |
run: cargo test --release --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3 | |
cross-platform-test: | |
needs: full-test | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
strategy: | |
matrix: | |
target: ["arm-unknown-linux-musleabi", "i586-unknown-linux-musl", "powerpc-unknown-linux-gnu", "mips-unknown-linux-musl", "mips64-unknown-linux-gnuabi64"] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install Rust Unix | |
run: | | |
if rustup --version >/dev/null 2>&1; then | |
rustup update | |
else | |
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable | |
echo ::add-path::$HOME/.cargo/bin | |
fi | |
- name: Install Cross | |
run: | | |
curl -L https://github.com/cross-rs/cross/releases/download/v0.2.1/cross-v0.2.1-x86_64-unknown-linux-musl.tar.gz | tar xfz - | |
cp cross $HOME/.cargo/bin | |
- name: Test ${{ matrix.target }} | |
run: cross test --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3 --release --target ${{ matrix.target }} |