This repository was archived by the owner on Sep 3, 2025. It is now read-only.
ci: Fix bump workflow #5
This file contains hidden or 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: Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_call: | |
| # Cancel previous runs for PRs but not pushes to main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| cargo-toml-features: | |
| name: Generate Feature Combinations | |
| runs-on: ubuntu-latest | |
| outputs: | |
| feature-combinations: ${{ steps.cargo-toml-features.outputs.feature-combinations }} | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Determine Cargo Features | |
| id: cargo-toml-features | |
| uses: Holzhaus/cargo-toml-features-action@3afa751aae4071b2d1ca1c5fa42528a351c995f4 | |
| build: | |
| needs: cargo-toml-features | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| features: ${{ fromJson(needs.cargo-toml-features.outputs.feature-combinations) }} | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Check out source repository | |
| uses: actions/checkout@v4 | |
| - name: Install FFmpeg (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt update | |
| sudo apt install -y ffmpeg | |
| - name: Install FFmpeg (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install ffmpeg | |
| - name: Install FFmpeg (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| choco install ffmpeg | |
| shell: powershell | |
| - name: Set up Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| continue-on-error: false | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-cargo- | |
| - name: Build | |
| run: cargo build --no-default-features --features "${{ join(matrix.features, ',') }}" | |
| - name: Run tests | |
| run: cargo test --no-default-features --features "${{ join(matrix.features, ',') }}" --no-fail-fast | |
| msrv: | |
| name: Current MSRV is 1.70.0 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Now check that `cargo build` works with respect to the oldest possible | |
| # deps and the stated MSRV | |
| - uses: dtolnay/rust-toolchain@1.70.0 | |
| - run: cargo build --all-features | |
| style: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out source repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| continue-on-error: false | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-cargo- | |
| - name: Format | |
| run: cargo fmt --check | |
| - name: Lint | |
| run: cargo clippy --all-features -- -Dwarnings | |
| - name: Check for debug macro | |
| run: "! grep -r 'dbg!' ./src" | |
| conventional-commits: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - run: pip3 install -U Commitizen | |
| - run: cz check --rev-range origin/${{ github.base_ref }}..HEAD |