2020-12-23 01:21:17 -05:00
|
|
|
name: CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
2021-03-12 12:24:20 -05:00
|
|
|
MOONFIRE_COLOR: always
|
2020-12-23 01:21:17 -05:00
|
|
|
RUST_BACKTRACE: 1
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
rust:
|
2021-08-12 01:27:36 -04:00
|
|
|
name: Rust ${{ matrix.rust }}
|
2020-12-23 01:21:17 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-07-04 17:59:10 -04:00
|
|
|
rust: [ "stable", "1.65", "nightly" ]
|
2020-12-23 01:21:17 -05:00
|
|
|
include:
|
|
|
|
- rust: nightly
|
|
|
|
extra_args: "--features nightly --benches"
|
2021-02-17 01:15:54 -05:00
|
|
|
- rust: stable
|
|
|
|
extra_components: rustfmt
|
2020-12-23 01:21:17 -05:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2021-02-01 00:55:25 -05:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/registry
|
|
|
|
~/.cargo/git
|
|
|
|
server/target
|
2023-01-08 05:07:17 -05:00
|
|
|
key: cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
cargo-${{ matrix.rust }}-
|
|
|
|
cargo-
|
2021-02-01 00:55:25 -05:00
|
|
|
- name: Install dependencies
|
2023-01-12 01:33:04 -05:00
|
|
|
# The retry here is to work around "Unable to connect to azure.archive.ubuntu.com" errors.
|
|
|
|
# https://github.com/actions/runner-images/issues/6894
|
|
|
|
run: sudo apt-get --option=APT::Acquire::Retries=3 update && sudo apt-get --option=APT::Acquire::Retries=3 install libncurses-dev libsqlite3-dev pkgconf
|
2021-02-01 00:55:25 -05:00
|
|
|
- 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 ${{ matrix.extra_args }} --all
|
2021-10-20 18:12:56 -04:00
|
|
|
continue-on-error: ${{ matrix.rust == 'nightly' }}
|
2021-02-01 00:55:25 -05:00
|
|
|
- name: Check formatting
|
|
|
|
if: matrix.rust == 'stable'
|
|
|
|
run: cd server && cargo fmt --all -- --check
|
2020-12-23 01:21:17 -05:00
|
|
|
js:
|
2021-08-12 01:27:36 -04:00
|
|
|
name: Node ${{ matrix.node }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-01-11 22:37:13 -05:00
|
|
|
node: [ "14", "16", "18" ]
|
2020-12-23 01:21:17 -05:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2021-02-01 00:55:25 -05:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with:
|
2021-08-12 01:27:36 -04:00
|
|
|
node-version: ${{ matrix.node }}
|
2021-02-01 00:55:25 -05:00
|
|
|
- run: cd ui && npm ci
|
|
|
|
- run: cd ui && npm run build
|
|
|
|
- run: cd ui && npm run test
|
|
|
|
- run: cd ui && npm run lint
|
|
|
|
- run: cd ui && npm run check-format
|
2021-02-17 16:28:48 -05:00
|
|
|
license:
|
|
|
|
name: Check copyright/license headers
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2021-02-01 00:55:25 -05:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- run: find . -type f -print0 | xargs -0 .github/workflows/check-license.py
|