From 26b29b30b1cfbd54c4a6fc49e9c61235d5ffbbf1 Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Sun, 26 Jul 2020 12:52:50 +0800 Subject: [PATCH] Add CI build on GitHub Actions --- .github/workflows/build.yml | 51 +++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..0535996 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +name: build +on: + push: + pull_request: + schedule: + - cron: "0 0 * * *" +jobs: + build-test-lint: + name: FFmpeg ${{ matrix.ffmpeg_version }} - build, test and lint + runs-on: ubuntu-latest + container: jrottenberg/ffmpeg:${{ matrix.ffmpeg_version }}-ubuntu + strategy: + matrix: + include: + - ffmpeg_version: '3.4' + ffmpeg_version_feature: + - ffmpeg_version: '4.0' + ffmpeg_version_feature: ffmpeg4 + - ffmpeg_version: '4.1' + ffmpeg_version_feature: ffmpeg41 + - ffmpeg_version: '4.2' + ffmpeg_version_feature: ffmpeg42 + - ffmpeg_version: '4.3' + ffmpeg_version_feature: ffmpeg43 + fail-fast: false + env: + FEATURES: ${{ matrix.ffmpeg_version_feature }},codec,device,filter,format,postprocessing,software-resampling,software-scaling + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + apt update + apt install -y --no-install-recommends clang curl pkg-config + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + components: rustfmt, clippy + - name: Build + run: | + cargo build --no-default-features --features $FEATURES + - name: Test + run: | + cargo test --no-default-features --features $FEATURES + - name: Lint + run: | + cargo clippy --no-default-features --features $FEATURES + - name: Check format + run: | + cargo fmt -- --check diff --git a/README.md b/README.md index bd3ffb3..735c359 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![crates.io](https://img.shields.io/crates/v/ffmpeg-next.svg)](https://crates.io/crates/ffmpeg-next) +[![build](https://github.com/zmwangx/rust-ffmpeg/workflows/build/badge.svg)](https://github.com/zmwangx/rust-ffmpeg/actions) This is a fork of the abandoned [ffmpeg](https://crates.io/crates/ffmpeg) crate by [meh.](https://github.com/meh/rust-ffmpeg).