Skip to content

Commit

Permalink
ci: add rustfmt, clippy job to rust.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ValuedMammal committed Sep 24, 2024
1 parent 8198031 commit ef6e235
Showing 1 changed file with 13 additions and 49 deletions.
62 changes: 13 additions & 49 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ jobs:
POSTGRES_DB: postgres
ports:
- 5432:5432
# redis:
# image: redis:7
# ports:
# - 6379:6379
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -49,53 +45,21 @@ jobs:
run: |
sudo apt-get install libpq-dev -y
./ci/init_db.sh
# - name: Check sqlx-data.json is up-to-date
# - name: Check .sqlx is up-to-date
# run: |
# cargo sqlx prepare --workspace --check
- name: Test
run: cargo test

# fmt:
# name: Rustfmt
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# with:
# components: rustfmt
# - name: Check fmt
# run: cargo fmt --check

# clippy:
# name: Clippy
# runs-on: ubuntu-latest
# services:
# postgres:
# image: postgres:14
# env:
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: password
# POSTGRES_DB: postgres
# ports:
# - 5432:5432
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# with:
# components: clippy
# - uses: Swatinem/rust-cache@v2
# with:
# key: sqlx-${{ env.SQLX_VERSION }}
# - name: Install sqlx-cli
# run:
# cargo install sqlx-cli
# --version=${{ env.SQLX_VERSION }}
# --features ${{ env.SQLX_FEATURES }}
# --no-default-features
# --locked
# - name: Migrate database
# run: |
# sudo apt-get install libpq-dev -y
# SKIP_DOCKER=true ./scripts/init_db.sh
# - name: Linting
# run: cargo clippy -- -D warnings
fmt-clippy:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Check fmt
run: cargo fmt --check
- name: Clippy
run: cargo clippy -- -D warnings

0 comments on commit ef6e235

Please sign in to comment.