mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-02-09 20:58:10 -05:00
This is a step toward H.265 recording support (#33) by using Retina for the `VisualSampleEncoding` instead of the prior H.264-specific logic. The only further change to Moonfire itself needed for H.265 is to add `| "h265"` to the check for the right video stream. This also adds support for recording MJPEG, although browser playback almost certainly won't work.
87 lines
2.4 KiB
YAML
87 lines
2.4 KiB
YAML
name: CI
|
|
on: [push, pull_request]
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
MOONFIRE_COLOR: always
|
|
RUST_BACKTRACE: 1
|
|
|
|
jobs:
|
|
rust:
|
|
name: Rust ${{ matrix.rust }}
|
|
strategy:
|
|
matrix:
|
|
rust: [ "stable", "1.79", "nightly" ]
|
|
include:
|
|
- rust: nightly
|
|
extra_args: "--features nightly --benches"
|
|
- rust: stable
|
|
extra_components: rustfmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
# `git describe` output gets baked into the binary for `moonfire-nvr --version`.
|
|
# Fetch all revs so it can see tag history.
|
|
fetch-depth: 0
|
|
filter: 'tree:0'
|
|
- name: Cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
server/target
|
|
key: cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
cargo-${{ matrix.rust }}-
|
|
cargo-
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: ${{ matrix.rust }}
|
|
override: true
|
|
components: ${{ matrix.extra_components }}
|
|
- name: Test
|
|
run: |
|
|
cd server
|
|
cargo test --features=rusqlite/bundled ${{ matrix.extra_args }} --all
|
|
continue-on-error: ${{ matrix.rust == 'nightly' }}
|
|
- name: Check formatting
|
|
if: matrix.rust == 'stable'
|
|
run: cd server && cargo fmt --all -- --check
|
|
js:
|
|
name: Node ${{ matrix.node }}
|
|
strategy:
|
|
matrix:
|
|
node: [ "18", "20", "21" ]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
# Install pnpm then use pnpm instead npm
|
|
- run: npm i -g pnpm
|
|
- run: cd ui && pnpm i --frozen-lockfile
|
|
- run: cd ui && pnpm run build
|
|
- run: cd ui && pnpm run test
|
|
- run: cd ui && pnpm run lint
|
|
- run: cd ui && pnpm run check-format
|
|
license:
|
|
name: Check copyright/license headers
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- run: find . -type f -print0 | xargs -0 .github/workflows/check-license.py
|