chore(deps): update actions/cache action to v4 #472
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: django-ci | |
on: | |
workflow_call: | |
workflow_dispatch: | |
push: | |
branches: [ "*" ] | |
pull_request: | |
branches: [ "*" ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_HOST: localhost | |
POSTGRES_DB: djtesting | |
POSTGRES_PORT: 5432 | |
DJANGO_SECRET_KEY: test-key | |
services: | |
postgres_main: | |
image: postgres:17 | |
env: | |
POSTGRES_USER: ${{ env.POSTGRES_USER }} | |
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | |
POSTGRES_DB: ${{ env.POSTGRES_DB }} | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.13.1 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13.1' | |
- name: Cache Poetry dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pypoetry | |
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
${{ runner.os }}-poetry- | |
- name: Setup environment | |
run: cp .env.defaults .env | |
- name: Install Poetry | |
run: | | |
pip install --upgrade pip | |
pip install poetry | |
- name: Configure Poetry | |
run: poetry config virtualenvs.create true | |
- name: Install dependencies | |
run: poetry install --no-root | |
- name: Create temporary directories | |
run: mkdir -p tmp | |
- name: Run Unit Tests | |
env: | |
PYTHONUNBUFFERED: 1 | |
run: poetry run pytest -v | |
- name: Run Django Tests | |
env: | |
DJANGO_SETTINGS_MODULE: "app.settings.development" | |
PYTHONUNBUFFERED: 1 | |
run: poetry run python manage.py test |