2020-12-22 22:21:17 -08:00
|
|
|
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
|
2021-01-22 14:43:41 -08:00
|
|
|
server/target
|
2020-12-22 22:21:17 -08:00
|
|
|
key: ${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Install dependencies
|
2021-01-22 10:30:55 -08:00
|
|
|
run: sudo apt-get update && sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libncurses-dev libsqlite3-dev pkgconf
|
2020-12-22 22:21:17 -08:00
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
override: true
|
|
|
|
- name: Test
|
2021-01-22 14:43:41 -08:00
|
|
|
run: cd server && cargo test ${{ matrix.extra_args }} --all
|
2020-12-22 22:21:17 -08:00
|
|
|
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'
|
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
|
|
with:
|
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-yarn-
|
2021-01-22 14:43:41 -08:00
|
|
|
- run: cd ui && yarn install
|
|
|
|
- run: cd ui && yarn build
|
|
|
|
- run: cd ui && yarn lint
|