Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update workflow with a few improvements: #39

Merged
merged 2 commits into from
Oct 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/feature-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ jobs:
until pg_isready -h localhost -p 5432 -U rustify_auth; do
sleep 1
done
sleep 5 # Extra wait to ensure the service is fully ready
sleep 5 # Additional wait to ensure readiness

- name: Run migrations
env:
DATABASE_URL: postgres://rustify_auth:password@localhost:5432/rustify_auth_db
run: |
# Create necessary tables for testing
echo "Running migrations..."
psql $DATABASE_URL <<EOF
CREATE TABLE IF NOT EXISTS clients (
client_id VARCHAR PRIMARY KEY,
Expand All @@ -83,13 +83,21 @@ jobs:
token_type VARCHAR DEFAULT 'Bearer'
);
EOF
echo "Migrations completed"
echo "Migrations completed successfully"

- name: Run cargo test
- name: Verify table setup (debugging step)
env:
DATABASE_URL: postgres://rustify_auth:password@localhost:5432/rustify_auth_db
run: |
echo "Checking tables in PostgreSQL..."
psql $DATABASE_URL -c "\dt"

- name: Run cargo test with backtrace enabled
env:
DATABASE_URL: postgres://rustify_auth:password@localhost:5432/rustify_auth_db
REDIS_URL: redis://localhost:6379
JWT_SECRET: test_secret
RUST_BACKTRACE: 1
run: cargo test -- --test-threads=1

format:
Expand Down
Loading