add starter files #1
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: Run Tests and Pre-Commit Hooks | |
on: [push] | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: DamianReeves/[email protected] | |
with: | |
path: .env | |
contents: | | |
DB_NAME=backend | |
DB_USER=backend | |
DB_PASSWORD=backend | |
DB_PORT=5432 | |
DEBUG=True | |
SECRET_KEY=very_insecure_key | |
write-mode: append | |
- name: Check env file | |
run: cat .env | |
- name: Spin up containers | |
run: docker compose up -d | |
- name: Check running containers | |
run: docker ps -a | |
- name: Check logs | |
run: docker compose logs backend | |
- name: Run tests | |
run: docker compose run --rm backend pytest -v --durations=5 -o cache_dir=/tmp/pytest_cache | |
run-pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements/dev.txt | |
- name: Run pre-commit hooks | |
run: pre-commit run --all-files --show-diff-on-failure |