mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-20 17:28:54 +00:00
49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
name: Build and Test
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
format_check:
|
|
name: Format check
|
|
runs_on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
components: rustfmt
|
|
- name: Run rustfmt
|
|
run: cargo fmt -- --check
|
|
check_and_test:
|
|
name: Lint and Test
|
|
runs_on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
- name: Check
|
|
run: cargo check --verbose
|
|
- name: Test
|
|
run: cargo test --verbose
|