From aab36bb5b6d2122da5ef1e7d0a055881cd51c80a Mon Sep 17 00:00:00 2001 From: Scott Lamb Date: Tue, 22 Dec 2020 22:21:17 -0800 Subject: [PATCH] replacing travis-ci with github actions --- .github/workflows/ci.yml | 62 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 46 ----------------------------- README.md | 2 ++ ci/script-rust.sh | 6 ---- guide/install-manual.md | 1 - scripts/setup-ubuntu.sh | 1 - 6 files changed, 64 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml delete mode 100755 ci/script-rust.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7a61fc6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d25d871..0000000 --- a/.travis.yml +++ /dev/null @@ -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 diff --git a/README.md b/README.md index 0207c62..0320ffb 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/ci/script-rust.sh b/ci/script-rust.sh deleted file mode 100755 index 6582551..0000000 --- a/ci/script-rust.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -e -cargo build --all -cargo test --all -if [ "$TRAVIS_RUST_VERSION" = nightly ]; then - cargo bench --all -fi diff --git a/guide/install-manual.md b/guide/install-manual.md index 147734b..f78a8c4 100644 --- a/guide/install-manual.md +++ b/guide/install-manual.md @@ -42,7 +42,6 @@ $ sudo apt-get install \ libncurses5-dev \ libncursesw5-dev \ libsqlite3-dev \ - libssl-dev \ pkgconf \ sqlite3 \ tzdata diff --git a/scripts/setup-ubuntu.sh b/scripts/setup-ubuntu.sh index 9e0379c..69aa89b 100755 --- a/scripts/setup-ubuntu.sh +++ b/scripts/setup-ubuntu.sh @@ -50,7 +50,6 @@ PKGS="build-essential \ libncurses5-dev \ libncursesw5-dev \ libsqlite3-dev \ - libssl-dev \ pkgconf \ sqlite3 \ tzdata"