From 2959ce12734312166dafd1df7ceadd54dee39275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20du=20Garreau?= Date: Tue, 16 Jan 2024 15:46:55 +0100 Subject: [PATCH] Improve CI --- .github/workflows/ci.yml | 70 +++++++---------------- symphonia-bundle-mp3/src/layer3/stereo.rs | 2 +- 2 files changed, 22 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c081b40..b78c8e8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,30 +17,24 @@ jobs: fail-fast: false steps: - - name: Checkout - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Setup Toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true + run: rustup install stable && rustup default stable - name: Check default features - uses: actions-rs/cargo@v1 - with: - command: check - args: --all + run: cargo check --all - name: Check all features - uses: actions-rs/cargo@v1 - with: - command: check - args: --all --all-features --exclude symphonia-play + run: cargo check --all --all-features --exclude symphonia-play test: name: Test ${{ matrix.config.target }} on ${{ matrix.config.os }} + env: + CARGO: cargo + CROSS_VERSION: v0.2.5 + runs-on: ${{ matrix.config.os }} strategy: matrix: @@ -51,35 +45,22 @@ jobs: - { os: ubuntu-latest, target: powerpc-unknown-linux-gnu, use-cross: true } steps: - - name: Checkout - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Setup Toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true + run: rustup install stable && rustup default stable + + - name: Setup Cross + if: matrix.config.use-cross + run: | + cargo install cross --locked + echo "CARGO=cross" >> $GITHUB_ENV - name: Test default features - uses: actions-rs/cargo@v1 - with: - command: test - args: --target ${{ matrix.config.target }} --all --exclude symphonia-play - use-cross: ${{ matrix.config.use-cross }} + run: ${{ env.CARGO }} test --target ${{ matrix.config.target }} --all --exclude symphonia-play - name: Test all features - uses: actions-rs/cargo@v1 - with: - command: test - args: --target ${{ matrix.config.target }} --all --all-features --exclude symphonia-play - use-cross: ${{ matrix.config.use-cross }} - - - name: Test documentation - uses: actions-rs/cargo@v1 - with: - command: test - args: --target ${{ matrix.config.target }} --all --all-features --doc --exclude symphonia-play - use-cross: ${{ matrix.config.use-cross }} + run: ${{ env.CARGO }} test --target ${{ matrix.config.target }} --all --all-features --exclude symphonia-play fmt: name: Rustfmt @@ -87,19 +68,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Setup Toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - components: rustfmt + run: rustup install nightly --profile minimal && rustup default nightly && rustup component add rustfmt - name: Check formatting - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run: cargo fmt --all -- --check diff --git a/symphonia-bundle-mp3/src/layer3/stereo.rs b/symphonia-bundle-mp3/src/layer3/stereo.rs index 4ac415f5..673c6f51 100644 --- a/symphonia-bundle-mp3/src/layer3/stereo.rs +++ b/symphonia-bundle-mp3/src/layer3/stereo.rs @@ -46,7 +46,7 @@ lazy_static! { /// /// The value of i0 is dependant on the least significant bit of scalefac_compress. /// - /// ```text + /// ```text /// scalefac_compress & 1 | i0 /// ----------------------+--------------------- /// 0 | 1 / sqrt(sqrt(2.0))