Skip to content

Removed duplicated migration (#29) #15

Removed duplicated migration (#29)

Removed duplicated migration (#29) #15

Workflow file for this run

name: Django CI
on:
push:
branches: [ "main", "22-implement-github-actions" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: github_actions
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Creating calories_tracker database
run: |
docker exec ${{ job.services.postgres.id }} bash -c "PGPASSWORD=postgres createdb -h localhost -U postgres calories_tracker"
- name: Wait for PostgreSQL
run: |
until pg_isready -h localhost -p 5432; do
echo "Waiting for PostgreSQL to become ready..."
sleep 2
done
- name: Install python dependencies ${{ matrix.python-version }} and other packages
run: |
sudo apt-get install python3.11 python3.11-venv exiftool
sudo python3.11 -m venv .python3.11
sudo .python3.11/bin/pip install .
- name: Run Tests
run: |
sudo .python3.11/bin/python manage.py test