lldap/.github/workflows/rust.yml
2021-06-23 10:57:43 +02:00

108 lines
2.4 KiB
YAML

name: Rust
on:
push:
branches: [ main ]
pull_request:
types: [opened, repoened, synchronize]
env:
CARGO_TERM_COLOR: always
jobs:
test_server:
name: cargo test server
runs-on: ubuntu-latest
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
runs-on: ubuntu-latest
steps:
- 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