hotfix: git action #33
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 CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test-ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.13.0 | |
- name: Install Poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: 1.8.4 | |
- name: Setup a local virtual environment | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- name: Define a cache for the virtual environment | |
uses: actions/cache@v4 | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }}-${{ runner.os }} | |
- name: Install dependencies | |
run: poetry install --with dev | |
- name: Create .env file | |
run: | | |
echo "SECRET_KEY=adsfgdsftrgdfsvdf" >> .env | |
echo "DEBUG=True" >> .env | |
echo "DATABASE_URL=sqlite:///db.sqlite3" >> .env | |
- name: Run migrations | |
run: poetry run python manage.py migrate | |
- name: Run Django system check | |
run: poetry run python manage.py check | |
- name: Run tests | |
env: | |
DJANGO_SETTINGS_MODULE: backoffice.settings.test | |
run: poetry run pytest -v --full-trace --showlocals --tb=long --capture=no |