| 1 |
name: av-scenechange |
| 2 |
|
| 3 |
on: |
| 4 |
pull_request: |
| 5 |
branches: |
| 6 |
- master |
| 7 |
push: |
| 8 |
branches: |
| 9 |
- master |
| 10 |
|
| 11 |
jobs: |
| 12 |
rustfmt: |
| 13 |
runs-on: ubuntu-latest |
| 14 |
|
| 15 |
steps: |
| 16 |
- uses: actions/checkout@v4 |
| 17 |
|
| 18 |
- name: Install nightly |
| 19 |
uses: dtolnay/rust-toolchain@nightly |
| 20 |
with: |
| 21 |
components: rustfmt |
| 22 |
|
| 23 |
- name: Run rustfmt |
| 24 |
run: | |
| 25 |
cargo fmt -- --check |
| 26 |
|
| 27 |
build: |
| 28 |
needs: [rustfmt] |
| 29 |
strategy: |
| 30 |
matrix: |
| 31 |
platform: [ubuntu-latest, windows-latest, ubuntu-24.04-arm] |
| 32 |
|
| 33 |
runs-on: ${{ matrix.platform }} |
| 34 |
|
| 35 |
steps: |
| 36 |
- uses: actions/checkout@v4 |
| 37 |
- uses: ilammy/setup-nasm@v1 |
| 38 |
|
| 39 |
- name: Install stable |
| 40 |
uses: dtolnay/rust-toolchain@stable |
| 41 |
with: |
| 42 |
components: clippy |
| 43 |
- uses: Swatinem/rust-cache@v2 |
| 44 |
|
| 45 |
- name: Set MSVC x86_64 linker path |
| 46 |
if: matrix.platform == 'windows-latest' |
| 47 |
run: | |
| 48 |
$LinkGlob = "VC\Tools\MSVC\*\bin\Hostx64\x64" |
| 49 |
$env:PATH = "$env:PATH;${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer" |
| 50 |
$LinkPath = vswhere -latest -products * -find "$LinkGlob" | |
| 51 |
Select-Object -Last 1 |
| 52 |
echo "$LinkPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append |
| 53 |
|
| 54 |
- name: Clippy |
| 55 |
run: cargo clippy --features binary,devel,tracing,serialize --tests --benches -- -D warnings |
| 56 |
|
| 57 |
- name: Build |
| 58 |
run: cargo build --features binary,devel,tracing,serialize --tests --benches |
| 59 |
|
| 60 |
- name: Run tests |
| 61 |
run: cargo test --features binary,devel,tracing,serialize |
| 62 |
|
| 63 |
- name: Generate docs |
| 64 |
run: cargo doc --features binary,devel,tracing,serialize --no-deps |
| 65 |
|
| 66 |
code-coverage: |
| 67 |
needs: [build] |
| 68 |
runs-on: ubuntu-latest |
| 69 |
|
| 70 |
steps: |
| 71 |
- uses: actions/checkout@v4 |
| 72 |
- uses: ilammy/setup-nasm@v1 |
| 73 |
|
| 74 |
- name: Install stable |
| 75 |
uses: dtolnay/rust-toolchain@stable |
| 76 |
- uses: Swatinem/rust-cache@v2 |
| 77 |
|
| 78 |
- name: Install cargo-llvm-cov |
| 79 |
uses: taiki-e/install-action@v2 |
| 80 |
with: |
| 81 |
tool: cargo-llvm-cov |
| 82 |
|
| 83 |
- name: Generate code coverage |
| 84 |
run: cargo llvm-cov --features binary,tracing,serialize --lcov --output-path lcov.log --ignore-filename-regex tests\.rs |
| 85 |
|
| 86 |
- name: Upload coverage to Codecov |
| 87 |
uses: codecov/codecov-action@v5 |
| 88 |
with: |
| 89 |
token: ${{ secrets.CODECOV_TOKEN }} |
| 90 |
files: lcov.log |
| 91 |
fail_ci_if_error: false |