Set up a workflow to build binaries
This commit is contained in:
parent
b66d32c84e
commit
2300c25a12
42
.github/workflows/build.yml
vendored
Normal file
42
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
name: Build binaries and publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
runs-on: node-16
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
- x86_64-unknown-linux-musl
|
||||
- aarch64-unknown-linux-gnu
|
||||
- aarch64-unknown-linux-musl
|
||||
|
||||
steps:
|
||||
- name: Packages
|
||||
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
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install Rust ${{ matrix.target }}
|
||||
uses: actions-rs/toolchain@v2
|
||||
with:
|
||||
toolchain: stable
|
||||
target: ${{ matrix.target }}
|
||||
override: false
|
||||
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: binary
|
||||
path: index.node
|
80
.github/workflows/rust.yml
vendored
80
.github/workflows/rust.yml
vendored
|
@ -1,80 +0,0 @@
|
|||
name: Rust
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build-test-lint-linux:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly-2023-02-16
|
||||
override: false
|
||||
- name: Packages
|
||||
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
|
||||
- name: Check format
|
||||
run: cargo fmt -- --check
|
||||
- name: Lint
|
||||
run: cargo clippy --examples --features=serde,library -- -D warnings
|
||||
- name: Build
|
||||
run: cargo build --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
- name: Run library tests
|
||||
run: cargo test --verbose --features=library
|
||||
- name: Run example tests
|
||||
run: cargo test --verbose --examples
|
||||
- name: Build benches
|
||||
run: cargo +nightly-2023-02-16 bench --verbose --features=bench --no-run
|
||||
- name: Build examples
|
||||
run: cargo build --examples --verbose --features=serde,library
|
||||
|
||||
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
|
||||
run: cargo clippy --examples --features=serde -- -D warnings
|
||||
- name: Check format
|
||||
run: cargo fmt -- --check
|
||||
- name: Build
|
||||
run: cargo build --examples
|
||||
- name: Test
|
||||
run: cargo test --examples --features=serde
|
Loading…
Reference in New Issue
Block a user