moonfire-nvr/.github/workflows/ci.yml
Scott Lamb 44039889c5 switch from yarn to npm
This eases build setup. Where Yarn requires a separate package
repository, npm is available in the standard one.

yarn's package repository signature was recently expired, and apparently
will expire again in a year. Avoid dealing with that.

Fixes #110.
2021-02-16 12:01:51 -08:00

57 lines
1.5 KiB
YAML

name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
rust:
name: Test Rust server code
strategy:
matrix:
rust:
- stable
- 1.45.0
- nightly
include:
- rust: nightly
extra_args: "--features nightly --benches"
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
server/target
key: ${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libncurses-dev libsqlite3-dev pkgconf
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Test
run: cd server && cargo test ${{ matrix.extra_args }} --all
js:
name: Build and lint Javascript frontend
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: cd ui && npm ci
- run: cd ui && npm run build
- run: cd ui && npm run lint