yaml is not easy #14
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: Tests | |
env: | |
CI: "1" | |
on: [push, pull_request] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:15-alpine | |
env: | |
POSTGRES_DB: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_PORT: 5432 | |
POSTGRES_USER: postgres | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Python Poetry Action | |
uses: abatilo/actions-poetry@v2.1.6 | |
with: | |
poetry-version: 1.3.1 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10.10' | |
cache: 'poetry' | |
- name: Install deps | |
run: | | |
poetry install | |
- name: Run Redis | |
run: | | |
docker compose up -d redis | |
- name: Unit Tests | |
run: poetry run python ./manage.py test | |
- name: Test w/ Production Dump | |
run: | | |
curl -fsSL -o /tmp/production-fixture.json ${{ secrets.PRODUCTION_FIXTURES_URL }} | |
poetry run ./manage.py testserver /tmp/production-fixture.json --noinput & | |
npm install | |
npm run cy:test | |