Skip to content

Merge pull request #181 from snypy/dependabot/pip/pytest-django-gte-4… #540

Merge pull request #181 from snypy/dependabot/pip/pytest-django-gte-4…

Merge pull request #181 from snypy/dependabot/pip/pytest-django-gte-4… #540

Workflow file for this run

name: Run linter and tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
env:
DEBUG: True
RUN_MODE: test
SECRET_KEY: changeme!
ALLOWED_HOSTS: localhost,127.0.0.1
DATABASE_URL: sqlite:////tmp/db.sqlite3
CORS_ORIGIN_WHITELIST: "http://localhost,http://127.0.0.1"
CSRF_TRUSTED_ORIGINS: "http://localhost"
REGISTER_VERIFICATION_URL: "http://localhost:4200/verify-user/"
RESET_PASSWORD_VERIFICATION_URL: "http://localhost:4200/reset-password/"
REGISTER_EMAIL_VERIFICATION_URL: "http://localhost:4200/verify-email/"
strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/test.txt
- name: Run black
run: |
pip install black
black --check snypy/
- name: Run tests
run: pytest --cov=. --cov-report xml
working-directory: snypy
- name: Generate OpenAPI
run: python manage.py spectacular --file schema.yml
working-directory: snypy
- name: Create artifact
if: ${{ matrix.python-version == '3.10' }}
uses: actions/upload-artifact@v4
with:
name: schema
path: snypy/schema.yml
if-no-files-found: error
- name: Upload coverage to Codecov
if: ${{ matrix.python-version == '3.10' }}
uses: codecov/codecov-action@v4
with:
directory: snypy
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}