Skip to content

Commit 32dde92

Browse files
author
vsilent
committed
sqlx-date.json check
1 parent 6b00be7 commit 32dde92

1 file changed

Lines changed: 0 additions & 68 deletions

File tree

‎.github/workflows/rust.yml‎

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -10,71 +10,8 @@ env:
1010
CARGO_TERM_COLOR: always
1111

1212
jobs:
13-
prepare-sqlx-cache:
14-
name: Prepare sqlx offline cache
15-
runs-on: ubuntu-latest
16-
env:
17-
SQLX_OFFLINE: false
18-
services:
19-
postgres:
20-
image: postgres:16
21-
env:
22-
POSTGRES_USER: postgres
23-
POSTGRES_PASSWORD: postgres
24-
POSTGRES_DB: stacker
25-
ports:
26-
- 5432:5432
27-
options: >-
28-
--health-cmd "pg_isready -U postgres"
29-
--health-interval 10s
30-
--health-timeout 5s
31-
--health-retries 5
32-
steps:
33-
- uses: actions/checkout@v4
34-
- name: Install Rust toolchain
35-
uses: actions-rs/toolchain@v1
36-
with:
37-
toolchain: stable
38-
profile: minimal
39-
override: true
40-
- name: Install sqlx-cli
41-
run: cargo install sqlx-cli --no-default-features --features postgres,rustls
42-
- name: Set DATABASE_URL
43-
run: echo "DATABASE_URL=postgres://postgres:postgres@localhost:5432/stacker" >> $GITHUB_ENV
44-
- name: Wait for Postgres
45-
run: |
46-
for i in {1..10}; do
47-
pg_isready -h localhost -U postgres && break
48-
sleep 3
49-
done
50-
- name: Create database (idempotent)
51-
run: sqlx database create || true
52-
- name: Run migrations
53-
run: sqlx migrate run
54-
- name: Check project compiles first
55-
run: cargo check --all-targets
56-
- name: Generate sqlx offline cache (sqlx 0.6)
57-
run: cargo sqlx prepare
58-
- name: Verify .sqlx/ cache was generated
59-
run: |
60-
if [ ! -d ".sqlx" ]; then
61-
echo "ERROR: .sqlx directory was not created"
62-
exit 1
63-
fi
64-
echo ".sqlx directory contents:"
65-
ls -lh .sqlx/ || echo "Directory empty or inaccessible"
66-
echo "Query cache files:"
67-
find .sqlx -type f | head -20
68-
- name: Upload .sqlx cache
69-
uses: actions/upload-artifact@v4
70-
with:
71-
name: sqlx-cache
72-
path: .sqlx
73-
if-no-files-found: error
74-
7513
build:
7614
name: Build binaries (Linux/macOS)
77-
needs: prepare-sqlx-cache
7815
env:
7916
SQLX_OFFLINE: true
8017
strategy:
@@ -92,11 +29,6 @@ jobs:
9229
runs-on: ${{ matrix.os }}
9330
steps:
9431
- uses: actions/checkout@v4
95-
- name: Download sqlx cache
96-
uses: actions/download-artifact@v4
97-
with:
98-
name: sqlx-cache
99-
path: .
10032
- name: Verify .sqlx/ cache exists
10133
run: |
10234
ls -lh .sqlx/ || echo ".sqlx directory not found"

0 commit comments

Comments
 (0)