From d530f4354cec7bbbd404a1edce92a0398f83dcea Mon Sep 17 00:00:00 2001 From: harudagondi Date: Sun, 18 Dec 2022 09:53:56 +0800 Subject: [PATCH] Add miri and replace action-rs (#56) - Fixes #54 - Fixes #45 --- .github/workflows/rust.yml | 71 +++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 167c6d6..67e928d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -29,18 +29,13 @@ jobs: ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-build-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }} - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + - name: rustup toolchain install + uses: dtolnay/rust-toolchain@stable - name: Install alsa and udev run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev if: runner.os == 'linux' - - uses: actions-rs/cargo@v1 - with: - command: test - args: --no-default-features --features ${{ matrix.feature }} + - name: Build & run tests + run: cargo test --no-default-features --features ${{ matrix.feature }} test: name: test @@ -60,51 +55,55 @@ jobs: ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-build-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }} - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + - name: rustup toolchain install + uses: dtolnay/rust-toolchain@stable - name: Install alsa and udev run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev if: runner.os == 'linux' - - uses: actions-rs/cargo@v1 - with: - command: test - args: --no-default-features + - name: Build & run tests + run: cargo test --no-default-features fmt: name: fmt runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + - name: rustup toolchain install + uses: dtolnay/rust-toolchain@stable - run: rustup component add rustfmt - name: Install alsa and udev run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - name: Check for correct formatting + run: cargo fmt --all -- --check clippy: name: clippy runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + - name: rustup toolchain install + uses: dtolnay/rust-toolchain@stable - run: rustup component add clippy - name: Install alsa and udev run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings \ No newline at end of file + - name: Run clippy + run: cargo clippy -- -D warnings + + miri: + name: miri + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + feature: [mp3, ogg, flac, wav] + steps: + - uses: actions/checkout@v3 + - name: Install Miri + run: | + rustup toolchain install nightly --component miri + rustup override set nightly + cargo miri setup + - name: Install alsa and udev + run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev + - name: Test with Miri + run: cargo miri test --no-default-features --features ${{ matrix.feature }}