CI: build and test all platforms #121
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_call: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
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: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --all-features --no-fail-fast | |
style: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out source repository | |
uses: actions/checkout@v4 | |
- name: Set up Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- run: cargo fmt -- --check | |
- run: cargo clippy -- -Dwarnings | |
- run: "! grep -r 'dbg!' ./src" | |
conventional-commits: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- run: pip3 install -U Commitizen | |
# The commit hash here is that of the commit where we started using conventional commits. | |
- run: cz check --rev-range 16610ddb..HEAD |