2020-09-16 02:11:49 +02:00
|
|
|
name: lint
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
fmt:
|
|
|
|
name: rustfmt check
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-12-11 16:20:19 +01:00
|
|
|
- uses: actions/checkout@v3
|
2020-09-16 02:11:49 +02:00
|
|
|
|
2022-12-11 16:20:19 +01:00
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
with: { components: rustfmt }
|
2020-09-16 02:11:49 +02:00
|
|
|
|
|
|
|
- name: rustfmt
|
2022-12-11 16:20:19 +01:00
|
|
|
run: cargo fmt --all -- --check
|
2020-09-16 02:11:49 +02:00
|
|
|
|
|
|
|
clippy:
|
|
|
|
name: clippy check
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2023-03-14 04:24:17 +01:00
|
|
|
env:
|
|
|
|
CI: 1
|
|
|
|
CARGO_INCREMENTAL: false
|
|
|
|
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
|
|
|
|
|
2020-09-16 02:11:49 +02:00
|
|
|
steps:
|
2022-12-11 16:20:19 +01:00
|
|
|
- uses: actions/checkout@v3
|
2020-09-16 02:11:49 +02:00
|
|
|
|
2022-12-11 16:20:19 +01:00
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
with: { components: clippy }
|
|
|
|
|
|
|
|
- name: Cache Dependencies
|
2023-03-14 04:24:17 +01:00
|
|
|
uses: Swatinem/rust-cache@v2.2.1
|
2020-09-16 02:11:49 +02:00
|
|
|
|
2022-02-06 17:31:44 +01:00
|
|
|
# - 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
|
2020-09-16 02:11:49 +02:00
|
|
|
|
|
|
|
- name: clippy
|
|
|
|
uses: actions-rs/clippy-check@v1
|
|
|
|
timeout-minutes: 30
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
args: --workspace --all-features --tests
|