replacing travis-ci with github actions

This commit is contained in:
Scott Lamb 2020-12-22 22:21:17 -08:00
parent b34914c73e
commit aab36bb5b6
6 changed files with 64 additions and 54 deletions

62
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,62 @@
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
target
key: ${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install dependencies
run: sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libncurses5-dev libncursesw5-dev libsqlite3-dev pkgconf
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Test
run: 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'
- 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-
- run: yarn install
- run: yarn build
- run: yarn lint

View File

@ -1,46 +0,0 @@
dist: bionic
addons:
apt:
packages:
- build-essential
- libavcodec-dev
- libavformat-dev
- libavutil-dev
- libncurses5-dev
- libncursesw5-dev
- libsqlite3-dev
- libssl-dev
- pkgconf
- yasm
matrix:
include:
- language: rust
rust: stable
script:
- ci/script-rust.sh
- language: rust
rust: nightly
script:
- ci/script-rust.sh
- language: rust
rust: 1.45.0
script:
- ci/script-rust.sh
- language: node_js
node_js: "node"
script:
- yarn
- yarn build
- yarn lint
- language: node_js
node_js: "lts/*"
script:
- yarn
- yarn build
- yarn lint
allow_failures:
- rust: nightly
cache:
cargo: true
yarn: true
timeout: 600

View File

@ -1,3 +1,5 @@
[![CI](https://github.com/scottlamb/moonfire-nvr/workflows/CI/badge.svg)](https://github.com/scottlamb/moonfire-nvr/actions?query=workflow%3ACI)
# Introduction
Moonfire NVR is an open-source security camera network video recorder, started

View File

@ -1,6 +0,0 @@
#!/bin/bash -e
cargo build --all
cargo test --all
if [ "$TRAVIS_RUST_VERSION" = nightly ]; then
cargo bench --all
fi

View File

@ -42,7 +42,6 @@ $ sudo apt-get install \
libncurses5-dev \
libncursesw5-dev \
libsqlite3-dev \
libssl-dev \
pkgconf \
sqlite3 \
tzdata

View File

@ -50,7 +50,6 @@ PKGS="build-essential \
libncurses5-dev \
libncursesw5-dev \
libsqlite3-dev \
libssl-dev \
pkgconf \
sqlite3 \
tzdata"