2021-05-14 17:35:08 +03:00
|
|
|
name: Rust
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
2022-02-17 19:42:05 +02:00
|
|
|
build-test-lint-linux:
|
2021-05-14 17:35:08 +03:00
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-05-15 19:32:13 +03:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2021-05-14 17:35:08 +03:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-02-16 20:18:39 +02:00
|
|
|
toolchain: nightly-2022-02-16
|
2021-05-14 17:35:08 +03:00
|
|
|
override: false
|
|
|
|
- name: Packages
|
2021-08-23 18:33:17 +03:00
|
|
|
run: sudo apt-get update && sudo apt-get install build-essential yasm libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavfilter-dev libavdevice-dev libswresample-dev libfftw3-dev ffmpeg
|
2022-04-11 18:26:05 +03:00
|
|
|
- name: Check format
|
|
|
|
run: cargo fmt -- --check
|
2023-02-14 18:52:23 +02:00
|
|
|
- name: Lint
|
|
|
|
run: cargo clippy --examples --features=serde,library -- -D warnings
|
2021-05-14 17:35:08 +03:00
|
|
|
- name: Build
|
|
|
|
run: cargo build --verbose
|
|
|
|
- name: Run tests
|
|
|
|
run: cargo test --verbose
|
2022-07-13 23:47:05 +03:00
|
|
|
- name: Run library tests
|
|
|
|
run: cargo test --verbose --features=library
|
2021-05-14 17:35:08 +03:00
|
|
|
- name: Run example tests
|
|
|
|
run: cargo test --verbose --examples
|
|
|
|
- name: Build benches
|
2022-02-16 20:18:39 +02:00
|
|
|
run: cargo +nightly-2022-02-16 bench --verbose --features=bench --no-run
|
2021-05-14 17:35:08 +03:00
|
|
|
- name: Build examples
|
2022-07-13 23:47:05 +03:00
|
|
|
run: cargo build --examples --verbose --features=serde,library
|
2022-02-17 19:42:05 +02:00
|
|
|
|
|
|
|
build-test-lint-windows:
|
|
|
|
name: Windows - build, test and lint
|
|
|
|
runs-on: windows-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- ffmpeg_version: latest
|
|
|
|
ffmpeg_download_url: https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z
|
|
|
|
fail-fast: false
|
|
|
|
env:
|
|
|
|
FFMPEG_DOWNLOAD_URL: ${{ matrix.ffmpeg_download_url }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
$VCINSTALLDIR = $(& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath)
|
|
|
|
Add-Content $env:GITHUB_ENV "LIBCLANG_PATH=${VCINSTALLDIR}\VC\Tools\LLVM\x64\bin`n"
|
|
|
|
Invoke-WebRequest "${env:FFMPEG_DOWNLOAD_URL}" -OutFile ffmpeg-release-full-shared.7z
|
|
|
|
7z x ffmpeg-release-full-shared.7z
|
|
|
|
mkdir ffmpeg
|
|
|
|
mv ffmpeg-*/* ffmpeg/
|
|
|
|
Add-Content $env:GITHUB_ENV "FFMPEG_DIR=${pwd}\ffmpeg`n"
|
|
|
|
Add-Content $env:GITHUB_PATH "${pwd}\ffmpeg\bin`n"
|
|
|
|
- name: Set up Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
- name: Lint
|
2022-02-17 23:43:28 +02:00
|
|
|
run: cargo clippy --examples --features=serde -- -D warnings
|
2022-02-17 19:42:05 +02:00
|
|
|
- name: Check format
|
2022-02-17 23:43:28 +02:00
|
|
|
run: cargo fmt -- --check
|
2023-02-14 18:52:23 +02:00
|
|
|
- name: Build
|
|
|
|
run: cargo build --examples
|
|
|
|
- name: Test
|
|
|
|
run: cargo test --examples --features=serde
|