-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (60 loc) · 2.1 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Rust
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update stable && rustup default stable
- run: rustup component add rustfmt
- run: cargo fmt --all --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt update && sudo apt install -y libavutil-dev libavformat-dev libavfilter-dev libavdevice-dev
- run: rustup update stable && rustup default stable
- run: rustup component add clippy
- run: cargo clippy -- -D warnings
test:
name: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install packages (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: sudo apt update && sudo apt install -y libavutil-dev libavformat-dev libavfilter-dev libavdevice-dev
- name: Install pacakges (macOs)
if: matrix.os == 'macos-latest'
run: brew install ffmpeg pkg-config
- name: Install pacakges (Windows)
if: matrix.os == 'windows-latest'
run: |
Invoke-WebRequest -Uri https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z -OutFile ffmpeg.7z
7z x ffmpeg.7z
- name: Build (Windows)
if: matrix.os == 'windows-latest'
run: |
$env:FFMPEG_DIR = "$(Get-Location)\ffmpeg-6.0-full_build-shared"; cargo build --verbose
cp "$(Get-Location)\ffmpeg-6.0-full_build-shared\bin\*" 'target\debug\'
- name: Build (Unix)
if: matrix.os != 'windows-latest'
run: cargo build --verbose
- name: Run tests (Unix)
if: matrix.os != 'windows-latest'
run: cargo test --verbose
- name: Run tests (Windows)
if: matrix.os == 'windows-latest'
run: |
$env:FFMPEG_DIR = "$(Get-Location)\ffmpeg-6.0-full_build-shared"; cargo build --verbose
cargo test --verbose