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.
 
 

113 lines
3.0 KiB

name: CI
on:
pull_request:
push:
branches:
- 'staging'
- 'master'
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dprint/check@v2.0
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
check_frontend:
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 run tsc
build_and_test_frontend:
strategy:
matrix:
app: [ maker, taker ]
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: APP=${{ matrix.app }} yarn test
- run: APP=${{ matrix.app }} yarn build
test_daemons:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup rust toolchain
run: rustup show
- uses: Swatinem/rust-cache@v1.3.0
- run: cargo build --bins --tests
- run: cargo test --workspace
- name: Smoke test ${{ matrix.os }} binary
shell: bash
run: |
target/debug/maker --data-dir=/tmp/maker --generate-seed testnet &
sleep 10s # Wait for maker to start
target/debug/taker --data-dir=/tmp/taker --generate-seed testnet &
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
- name: Setup rust toolchain
run: rustup show
- uses: Swatinem/rust-cache@v1.3.0
- name: Install compiler for armhf arch
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf
- run: cargo build --target=armv7-unknown-linux-gnueabihf --bins
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: maker-and-taker-binaries-armv7
path: |
target/armv7-unknown-linux-gnueabihf/debug/maker
target/armv7-unknown-linux-gnueabihf/debug/taker