Skip to content

Commit

Permalink
Create test-sql-queries.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbs authored Jul 23, 2024
1 parent 985a987 commit 79f8de0
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/test-sql-queries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test SQL Queries
on:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: testdb
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Wait for PostgreSQL to be ready
run: |
until pg_isready -h localhost -p 5432; do
sleep 1
done
- name: Run create-tables.sql
env:
PGPASSWORD: postgres
run: psql -h localhost -U postgres -d testdb -f create-tables.sql
- name: Run drop-tables.sql
env:
PGPASSWORD: postgres
run: psql -h localhost -U postgres -d testdb -f drop-tables.sql

0 comments on commit 79f8de0

Please sign in to comment.