-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,21 @@ | ||
name: CI | ||
on: [ push, pull_request ] | ||
jobs: | ||
test: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: myimage/django-server:base | ||
ports: | ||
- 8000:8000 | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: admin | ||
POSTGRES_DB: mydb | ||
ports: | ||
- 5432:5432 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
||
env: | ||
POSTGRES_HOST: postgres | ||
POSTGRES_PORT: 5432 | ||
POSTGRES_PASSWORD: admin | ||
POSTGRES_USER: postgres | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: chartboost/ruff-action@v1 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Run PyTest | ||
run: | | ||
- name: Build and run with Docker Compose | ||
run: | | ||
docker-compose up -f "dev/docker/docker-compose.yml" up -d --build --abort-on-container-exitup | ||
- 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 | ||