Improve docker-compose setup to include owncast #138
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Pipeline | |
on: | |
push: | |
branches: | |
- main | |
- master | |
- staging | |
- trying | |
- "renovate/**" | |
tags: | |
- "*" | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_INCREMENTAL: '0' | |
CARGO_PROFILE_DEV_DEBUG: '0' | |
RUSTFLAGS: "-D warnings" | |
RUSTDOCFLAGS: "-D warnings" | |
RUST_LOG: "info" | |
jobs: | |
# Identify unused dependencies | |
run_udeps: | |
name: Run Cargo Udeps | |
runs-on: ubuntu-latest | |
env: | |
RUSTC_BOOTSTRAP: 1 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
override: true | |
- name: Install libvncserver-dev | |
run: sudo apt install -y libvncserver-dev | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: install | |
args: cargo-udeps --locked | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: udeps | |
run_rustfmt: | |
name: Run Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
components: rustfmt | |
override: true | |
- name: Install libvncserver-dev | |
run: sudo apt install -y libvncserver-dev | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
run_clippy: | |
name: Run Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
components: clippy | |
override: true | |
- name: Install libvncserver-dev | |
run: sudo apt install -y libvncserver-dev | |
- name: Run clippy action to produce annotations | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
uses: actions-rs/clippy-check@v1 | |
if: env.GITHUB_TOKEN != null | |
with: | |
args: --all-targets -- -D warnings | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run clippy manually without annotations | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: env.GITHUB_TOKEN == null | |
run: cargo clippy --all-targets -- -D warnings | |
run_rustdoc: | |
name: Run RustDoc | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
components: rustfmt | |
override: true | |
- name: Install libvncserver-dev | |
run: sudo apt install -y libvncserver-dev | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: doc | |
args: --document-private-items | |
run_tests: | |
name: Run Cargo Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
override: true | |
- name: Install libvncserver-dev | |
run: sudo apt install -y libvncserver-dev | |
- name: Test with all features turned off | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --no-default-features | |
- name: Test with all features turned on | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --all-features | |
- name: Test vnc features | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --no-default-features --features vnc | |
run_build: | |
name: Build for ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
file-suffix: "" | |
# - target: x86_64-pc-windows-gnu | |
# os: windows-latest | |
# file-suffix: ".exe" | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
file-suffix: "" | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
file-suffix: "" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
target: ${{ matrix.target }} | |
override: true | |
- name: Print CPU architecture | |
run: uname -m && uname -a | |
- if: runner.os == 'Linux' | |
run: sudo apt install -y libvncserver-dev | |
- if: runner.os == 'macOS' | |
run: brew install libvncserver | |
# - if: runner.os == 'Windows' | |
# uses: egor-tensin/setup-cygwin@v3 | |
# with: | |
# platform: x64 | |
# packages: pkg-config libvncserver-devel | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --target=${{ matrix.target }} --no-default-features | |
# Currently the macOS build is broken because of | |
# | |
# error: failed to run custom build command for `vncserver v0.2.2 (https://github.com/sbernauer/libvnc-rs.git#2bf903ad)` | |
# thread 'main' panicked at /Users/runner/.cargo/git/checkouts/libvnc-rs-5fba04f2b7022219/2bf903a/vncserver/build.rs:9:66: | |
# called `Result::unwrap()` on an `Err` value: pkg-config has not been configured to support cross-compilation. | |
# | |
# This is because GitHub switched their macOS runners to use arm, and they currently can not cross-compile to x86. | |
# What a time to be alive! | |
# | |
# - uses: actions-rs/cargo@v1 | |
# with: | |
# command: build | |
# args: --target=${{ matrix.target }} --all-features |