Skip to content

Commit

Permalink
add sqlx-prepare ci job
Browse files Browse the repository at this point in the history
  • Loading branch information
kayhhh committed Dec 29, 2023
1 parent a245109 commit 0e2c5f9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 48 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,28 @@ on:
pull_request:

jobs:
sqlx-prepare:
runs-on: ubuntu-latest
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: Swatinem/rust-cache@v2
- run: nix develop -c cargo sqlx prepare --workspace
- run: nix develop -c cargo sqlx prepare --workspace -- --tests
- uses: actions/upload-artifact@v4
with:
name: sqlx
path: .sqlx
- uses: EndBug/add-and-commit@v9
with:
message: "chore: sqlx prepare"
default_author: github_actions

check:
needs: sqlx-prepare
runs-on: ubuntu-latest
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
Expand All @@ -17,11 +38,16 @@ jobs:
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: Swatinem/rust-cache@v2
- uses: actions/download-artifact@v4
with:
name: sqlx
path: .sqlx
- run: nix flake check --all-systems
- run: nix develop -c cargo doc --workspace --all-features --no-deps --document-private-items
- run: nix develop -c cargo test --workspace --all-features

lint:
needs: sqlx-prepare
runs-on: ubuntu-latest
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
Expand All @@ -31,6 +57,10 @@ jobs:
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: Swatinem/rust-cache@v2
- uses: actions/download-artifact@v4
with:
name: sqlx
path: .sqlx
- run: nix develop -c cargo clippy --fix --no-deps
- uses: EndBug/add-and-commit@v9
with:
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 0e2c5f9

Please sign in to comment.