mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-19 00:38:54 +00:00
69 lines
2 KiB
YAML
69 lines
2 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-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
components: rustfmt
|
|
- name: Run rustfmt
|
|
run: cargo fmt -- --check
|
|
check:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
id: cargo
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-rust-${{ steps.cargo.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}-lint
|
|
- name: Run cargo check
|
|
run: cargo check
|
|
env:
|
|
SQLX_OFFLINE: "true"
|
|
- name: Run clippy
|
|
run: cargo clippy
|
|
env:
|
|
SQLX_OFFLINE: "true"
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
id: cargo
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-rust-${{ steps.cargo.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}-debug-build
|
|
- name: Run cargo test
|
|
run: cargo test
|
|
env:
|
|
SQLX_OFFLINE: "true"
|