diff --git a/.github/workflows/av-scenechange.yml b/.github/workflows/av-scenechange.yml index 3ac5c5e..64c71cc 100644 --- a/.github/workflows/av-scenechange.yml +++ b/.github/workflows/av-scenechange.yml @@ -9,41 +9,38 @@ on: - master jobs: - clippy-rustfmt: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - - name: Install stable - uses: dtolnay/rust-toolchain@stable - with: - components: clippy, rustfmt - - - name: Install nasm - env: - LINK: http://debian-archive.trafficmanager.net/debian/pool/main/n/nasm - NASM_VERSION: 2.15.05-1 - NASM_SHA256: >- - c860caec653b865d5b83359452d97b11f1b3ba5b18b07cac554cf72550b3bfc9 - run: | - curl -O "$LINK/nasm_${NASM_VERSION}_amd64.deb" - echo "$NASM_SHA256 nasm_${NASM_VERSION}_amd64.deb" | sha256sum --check - sudo dpkg -i "nasm_${NASM_VERSION}_amd64.deb" - - - name: Run rustfmt - run: | - cargo fmt -- --check --verbose - - - name: Run clippy - uses: clechasseur/rs-clippy-check@v3 - with: - args: -- -D warnings --verbose -A clippy::wrong-self-convention -A clippy::many_single_char_names -A clippy::upper-case-acronyms + - uses: actions/checkout@v4 + + - name: Install stable + uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + + - name: Install nasm + env: + LINK: http://debian-archive.trafficmanager.net/debian/pool/main/n/nasm + NASM_VERSION: 2.15.05-1 + NASM_SHA256: >- + c860caec653b865d5b83359452d97b11f1b3ba5b18b07cac554cf72550b3bfc9 + run: | + curl -O "$LINK/nasm_${NASM_VERSION}_amd64.deb" + echo "$NASM_SHA256 nasm_${NASM_VERSION}_amd64.deb" | sha256sum --check + sudo dpkg -i "nasm_${NASM_VERSION}_amd64.deb" + + - name: Run rustfmt + run: | + cargo fmt -- --check --verbose + + - name: Run clippy + uses: clechasseur/rs-clippy-check@v3 + with: + args: -- -D warnings --verbose -A clippy::wrong-self-convention -A clippy::many_single_char_names -A clippy::upper-case-acronyms build: - strategy: matrix: platform: [ubuntu-latest, windows-latest] @@ -51,46 +48,52 @@ jobs: runs-on: ${{ matrix.platform }} steps: - - uses: actions/checkout@v4 - - - name: Install stable - uses: dtolnay/rust-toolchain@stable - - - name: Install nasm for Ubuntu - if: matrix.platform == 'ubuntu-latest' - env: - LINK: http://debian-archive.trafficmanager.net/debian/pool/main/n/nasm - NASM_VERSION: 2.15.05-1 - NASM_SHA256: >- - c860caec653b865d5b83359452d97b11f1b3ba5b18b07cac554cf72550b3bfc9 - run: | - curl -O "$LINK/nasm_${NASM_VERSION}_amd64.deb" - echo "$NASM_SHA256 nasm_${NASM_VERSION}_amd64.deb" | sha256sum --check - sudo dpkg -i "nasm_${NASM_VERSION}_amd64.deb" - - - name: Install nasm for Windows - if: matrix.platform == 'windows-latest' - run: | - $NASM_VERSION="2.15.05" - $LINK="https://www.nasm.us/pub/nasm/releasebuilds/$NASM_VERSION/win64" - curl -LO "$LINK/nasm-$NASM_VERSION-win64.zip" - 7z e -y "nasm-$NASM_VERSION-win64.zip" -o"C:\nasm" - echo "C:\nasm" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - - name: Set MSVC x86_64 linker path - if: matrix.platform == 'windows-latest' - run: | - $LinkGlob = "VC\Tools\MSVC\*\bin\Hostx64\x64" - $env:PATH = "$env:PATH;${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer" - $LinkPath = vswhere -latest -products * -find "$LinkGlob" | - Select-Object -Last 1 - echo "$LinkPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - - name: Build - run: cargo build --all-features --tests --benches - - - name: Run tests - run: cargo test --all-features - - - name: Generate docs - run: cargo doc --all-features --no-deps + - uses: actions/checkout@v4 + + - name: Install stable + uses: dtolnay/rust-toolchain@stable + + - name: Install nasm for Ubuntu + if: matrix.platform == 'ubuntu-latest' + env: + LINK: http://debian-archive.trafficmanager.net/debian/pool/main/n/nasm + NASM_VERSION: 2.15.05-1 + NASM_SHA256: >- + c860caec653b865d5b83359452d97b11f1b3ba5b18b07cac554cf72550b3bfc9 + run: | + curl -O "$LINK/nasm_${NASM_VERSION}_amd64.deb" + echo "$NASM_SHA256 nasm_${NASM_VERSION}_amd64.deb" | sha256sum --check + sudo dpkg -i "nasm_${NASM_VERSION}_amd64.deb" + + - name: Install nasm for Windows + if: matrix.platform == 'windows-latest' + run: | + $NASM_VERSION="2.15.05" + $LINK="https://www.nasm.us/pub/nasm/releasebuilds/$NASM_VERSION/win64" + curl -LO "$LINK/nasm-$NASM_VERSION-win64.zip" + 7z e -y "nasm-$NASM_VERSION-win64.zip" -o"C:\nasm" + echo "C:\nasm" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Set MSVC x86_64 linker path + if: matrix.platform == 'windows-latest' + run: | + $LinkGlob = "VC\Tools\MSVC\*\bin\Hostx64\x64" + $env:PATH = "$env:PATH;${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer" + $LinkPath = vswhere -latest -products * -find "$LinkGlob" | + Select-Object -Last 1 + echo "$LinkPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Install VapourSynth + uses: rlaphoenix/install-vapoursynth-action@v2.1.1 + with: + version: 66 + cache: true + + - name: Build + run: cargo build --all-features --tests --benches + + - name: Run tests + run: cargo test --all-features + + - name: Generate docs + run: cargo doc --all-features --no-deps