You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
138 lines
3.6 KiB
138 lines
3.6 KiB
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- 'staging'
|
|
- 'master'
|
|
|
|
jobs:
|
|
formatting:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
- uses: dprint/check@v2.0
|
|
|
|
clippy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
- name: Setup rust toolchain
|
|
run: rustup show
|
|
- uses: Swatinem/rust-cache@v1.3.0
|
|
- run: cargo clippy --workspace --all-targets -- -D warnings
|
|
|
|
check_maker_frontend:
|
|
defaults:
|
|
run:
|
|
working-directory: maker-frontend
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
cache: 'yarn'
|
|
cache-dependency-path: maker-frontend/yarn.lock
|
|
- run: yarn install
|
|
- run: yarn run eslint
|
|
- run: yarn run tsc
|
|
|
|
check_taker_frontend:
|
|
defaults:
|
|
run:
|
|
working-directory: taker-frontend
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
cache: 'yarn'
|
|
cache-dependency-path: taker-frontend/yarn.lock
|
|
- run: yarn install
|
|
- run: yarn run eslint
|
|
- run: yarn run tsc
|
|
- run: yarn run npmPkgJsonLint .
|
|
|
|
build_and_test_maker_frontend:
|
|
defaults:
|
|
run:
|
|
working-directory: maker-frontend
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
cache: 'yarn'
|
|
cache-dependency-path: maker-frontend/yarn.lock
|
|
- run: yarn install
|
|
- run: yarn test
|
|
- run: yarn build
|
|
|
|
build_and_test_taker_frontend:
|
|
defaults:
|
|
run:
|
|
working-directory: taker-frontend
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
cache: 'yarn'
|
|
cache-dependency-path: taker-frontend/yarn.lock
|
|
- run: yarn install
|
|
- run: yarn build
|
|
|
|
test_daemons:
|
|
strategy:
|
|
matrix:
|
|
os: [ ubuntu-latest, macos-latest ]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
- name: Setup rust toolchain
|
|
run: rustup show
|
|
- uses: Swatinem/rust-cache@v1.3.0
|
|
- run: cargo build --bins --tests
|
|
- run: cargo test --workspace
|
|
# Ignored tests should be run on the CI
|
|
- run: cargo test --workspace -- --ignored
|
|
- name: Smoke test ${{ matrix.os }} binary
|
|
shell: bash
|
|
run: |
|
|
cargo dev-maker &
|
|
sleep 10s # Wait for maker to start\
|
|
|
|
cargo dev-taker &
|
|
sleep 10s # Wait for taker to start
|
|
|
|
curl --fail http://localhost:8000/api/alive
|
|
curl --fail http://localhost:8001/api/alive
|
|
- name: Upload binaries
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: maker-and-taker-binaries-${{ matrix.os }}
|
|
path: |
|
|
target/debug/maker
|
|
target/debug/taker
|
|
|
|
daemons_arm_build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
- name: Setup rust toolchain
|
|
run: rustup show
|
|
- uses: Swatinem/rust-cache@v1.3.0
|
|
|
|
- name: Install compiler for aarch64 arch
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install gcc-aarch64-linux-gnu
|
|
- run: cargo build --target=aarch64-unknown-linux-gnu --bins
|
|
- name: Upload binaries
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: maker-and-taker-binaries-aarch64-unknown-linux-gnu
|
|
path: |
|
|
target/aarch64-unknown-linux-gnu/debug/maker
|
|
target/aarch64-unknown-linux-gnu/debug/taker
|
|
|