Configura testes no GitHub CI #2
Workflow file for this run
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
name: Test | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
POSTGRES_DB: queremossaber | |
POSTGRES_USER: queremossaber | |
POSTGRES_PASSWORD: queremossaber | |
DATABASE_URL: postgresql://queremossaber:queremossaber@postgres:5432/queremossaber | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9"] | |
services: | |
postgres: | |
image: postgres:9.5 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip poetry | |
make install | |
- name: Copy environment file | |
run: | | |
grep -v DATABASE_URL .env.example > .env | |
cat .env | |
- name: Test | |
run: make test | |
- name: Run migrations | |
run: make migrate | |
- name: Load fixtures | |
run: make load_fixtures |