Skip to content

Update python-cicd.yml #17

Update python-cicd.yml

Update python-cicd.yml #17

Workflow file for this run

name: CI
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
services:
docker:
image: docker:stable-dind
options: --privileged
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Start PostgreSQL containers
run: docker-compose up -d
- name: Wait for services to be ready
run: |
while ! docker-compose exec -T postgresql pg_isready -q -h postgresql -p 5432 -U postgres && ! docker-compose exec -T postgresql-test pg_isready -q -h postgresql-test -p 5433 -U postgres; do
sleep 1
done
- name: Run tests
run: |
docker-compose run app sh -c "pytest"
- name: Stop PostgreSQL containers
run: docker-compose down