|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'staging'
|
|
|
|
- 'master'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
formatting:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: dprint/check@v1.5
|
|
|
|
|
|
|
|
clippy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
toolchain: stable
|
|
|
|
components: clippy
|
|
|
|
- uses: Swatinem/rust-cache@v1.3.0
|
|
|
|
- run: cargo clippy --workspace --all-targets -- -D warnings
|
|
|
|
|
|
|
|
yarn:
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: frontend
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
cache: 'yarn'
|
|
|
|
cache-dependency-path: frontend/yarn.lock
|
|
|
|
- run: yarn install
|
|
|
|
- run: yarn run eslint
|
|
|
|
- run: yarn build
|
|
|
|
|
|
|
|
cargo:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
target: [ x86_64-unknown-linux-gnu, x86_64-apple-darwin ]
|
|
|
|
include:
|
|
|
|
- target: x86_64-unknown-linux-gnu
|
|
|
|
os: ubuntu-latest
|
|
|
|
- target: x86_64-apple-darwin
|
|
|
|
os: macos-latest
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
toolchain: stable
|
|
|
|
- uses: Swatinem/rust-cache@v1.3.0
|
|
|
|
- run: cargo test --workspace --all-features
|
|
|
|
- run: cargo build --target=${{ matrix.target }} --release --bin maker --bin taker
|
|
|
|
- name: Smoke test ${{ matrix.target }} release binary
|
|
|
|
run: |
|
|
|
|
target/${{ matrix.target }}/release/maker &
|
|
|
|
sleep 5s # Wait for maker to start
|
|
|
|
target/${{ matrix.target }}/release/taker &
|
|
|
|
sleep 5s # Wait for taker to start
|
|
|
|
curl --fail http://localhost:8000/alive
|