Launch project on VS Code startup #370
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
# .github/workflows/app.yaml | |
name: pytest | |
on: push | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: test_db | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd "pg_isready -U postgres" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
# Setup Python (faster than using Python container) | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" | |
- name: Install poetry | |
run: | | |
python -m pip install --upgrade poetry wheel | |
- id: cache-poetry | |
uses: actions/cache@v1 | |
with: | |
path: ~/.config/pypoetry/virtualenvs | |
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cache-poetry.outputs.cache-hit != 'true' | |
run: | | |
poetry install --with=dev | |
- name: Run test suite | |
env: | |
TEST_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test_db | |
run: | | |
poetry run pytest -v |