2021-05-30 20:03:53 +00:00
|
|
|
name: Rust
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
pull_request:
|
2021-06-23 08:57:43 +00:00
|
|
|
types: [opened, repoened, synchronize]
|
2021-05-30 20:03:53 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
2021-06-23 08:57:43 +00:00
|
|
|
test_server:
|
|
|
|
name: cargo test server
|
|
|
|
runs-on: ubuntu-latest
|
2021-05-30 20:03:53 +00:00
|
|
|
|
2021-06-23 08:57:43 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Build
|
|
|
|
run: cargo build --verbose
|
|
|
|
- name: Run tests
|
|
|
|
run: cargo test --verbose
|
|
|
|
|
|
|
|
test_client:
|
|
|
|
name: cargo test client
|
2021-05-30 20:03:53 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2021-06-23 08:57:43 +00:00
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Build
|
|
|
|
run: cargo build --verbose
|
|
|
|
working-directory: ./app
|
|
|
|
- name: Run tests
|
|
|
|
run: cargo test --verbose
|
|
|
|
working-directory: ./app
|
|
|
|
|
|
|
|
clippy:
|
|
|
|
name: cargo clippy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install nightly toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
|
|
|
|
- name: Run cargo clippy on server
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: clippy
|
|
|
|
args: --tests -- -D warnings
|
|
|
|
|
|
|
|
- name: Run cargo clippy on client
|
|
|
|
working-directory: ./app
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: clippy
|
|
|
|
args: --tests -- -D warnings
|
|
|
|
|
|
|
|
- name: Run cargo clippy on model
|
|
|
|
working-directory: ./model
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: clippy
|
|
|
|
args: --tests -- -D warnings
|
|
|
|
|
|
|
|
|
|
|
|
format:
|
|
|
|
name: cargo fmt
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install nightly toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
|
|
|
|
- name: Run cargo fmt on server
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|
|
|
|
|
|
|
|
- name: Run cargo fmt on client
|
|
|
|
working-directory: ./app
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|
|
|
|
|
|
|
|
- name: Run cargo fmt on model
|
|
|
|
working-directory: ./model
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|