Skip to content

Commit

Permalink
Revise workflow to ensure that all required tables are created proper…
Browse files Browse the repository at this point in the history
…ly in GitHub Actions
  • Loading branch information
Mehrn0ush committed Oct 26, 2024
1 parent a5bd4ca commit 4a34cae
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/feature-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,26 @@ jobs:
env:
DATABASE_URL: postgres://rustify_auth:password@localhost:5432/rustify_auth_db
run: |
# Add the actual migration commands here or run a script if migrations are stored in a file
# For example, if using Diesel or SQLx, replace with the correct command:
echo "CREATE TABLE IF NOT EXISTS tokens (
access_token VARCHAR PRIMARY KEY,
refresh_token VARCHAR,
expires_at TIMESTAMP,
scope VARCHAR,
client_id VARCHAR REFERENCES clients(client_id),
token_type VARCHAR DEFAULT 'Bearer'
);" | psql $DATABASE_URL
# Create necessary tables for testing
psql $DATABASE_URL <<EOF
CREATE TABLE IF NOT EXISTS clients (
client_id VARCHAR PRIMARY KEY,
secret VARCHAR NOT NULL,
redirect_uris JSONB NOT NULL,
grant_types JSONB,
response_types JSONB,
software_statement TEXT
);
CREATE TABLE IF NOT EXISTS tokens (
access_token VARCHAR PRIMARY KEY,
refresh_token VARCHAR,
expires_at TIMESTAMP,
scope VARCHAR,
client_id VARCHAR REFERENCES clients(client_id),
token_type VARCHAR DEFAULT 'Bearer'
);
EOF
echo "Migrations completed"
- name: Run cargo test
Expand Down Expand Up @@ -140,4 +150,4 @@ jobs:
toolchain: stable

- name: Run linter
run: cargo clippy -- -D warnings
run: cargo clippy -- -D warnings

0 comments on commit 4a34cae

Please sign in to comment.