mirror of
https://github.com/actix/examples
synced 2024-11-30 17:14:35 +01:00
50 lines
1.2 KiB
YAML
50 lines
1.2 KiB
YAML
name: lint
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
|
|
jobs:
|
|
fmt:
|
|
name: rustfmt check
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with: { components: rustfmt }
|
|
|
|
- name: rustfmt
|
|
run: cargo fmt --all -- --check
|
|
|
|
clippy:
|
|
name: clippy check
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with: { components: clippy }
|
|
|
|
- run: cargo generate-lockfile
|
|
- name: Cache Dependencies
|
|
uses: Swatinem/rust-cache@v2.2.0
|
|
|
|
# - name: Create test DBs
|
|
# run: |
|
|
# sudo apt-get update && sudo apt-get install sqlite3
|
|
# cargo install sqlx-cli --no-default-features --features=rustls,sqlite
|
|
# cd basics/todo
|
|
# DATABASE_URL="sqlite://./todo.db" sqlx database create
|
|
# chmod a+rwx todo.db
|
|
# DATABASE_URL="sqlite://./todo.db" sqlx migrate run
|
|
|
|
- name: clippy
|
|
uses: actions-rs/clippy-check@v1
|
|
timeout-minutes: 30
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
args: --workspace --all-features --tests
|