Skip to content

Commit

Permalink
test requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshod5 committed May 13, 2024
1 parent 66e0e30 commit 28d11b8
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: CI

on: [ push, pull_request ]

jobs:
ruff:
runs-on: ubuntu-latest
Expand All @@ -21,6 +23,15 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1

# Add a step to start up the PostgreSQL container
- name: Start PostgreSQL container
run: docker run --name test-postgres -e POSTGRES_PASSWORD=password -p 5432:5432 -d postgres

# Add a step to wait for the PostgreSQL container to be ready
- name: Wait for PostgreSQL to be ready
run: dockerize -wait tcp://localhost:5432 -timeout 1m

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -29,4 +40,8 @@ jobs:
- name: Run PyTest
run: |
pip install pytest
pytest tests/test_mock_db.py --data-path=data/metadata/mini
pytest tests/test_mock_db.py --data-path=data/metadata/mini
# Add a step to stop and remove the PostgreSQL container after tests
- name: Stop PostgreSQL container
run: docker stop test-postgres && docker rm test-postgres

0 comments on commit 28d11b8

Please sign in to comment.