Tests / test (pull_request) Successful in 7m2s
The Gitea runner can't clone github.com repos via pip. Since the tests don't need Search-Engines-Scraper, exclude git+ lines from requirements during CI install. Co-Authored-By: opencode <noreply@opencode.ai>
58 lines
1.3 KiB
YAML
58 lines
1.3 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:17
|
|
env:
|
|
POSTGRES_DB: matitos
|
|
POSTGRES_USER: supermatitos
|
|
POSTGRES_PASSWORD: supermatitos
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
|
|
env:
|
|
DJANGO_SECRET_KEY: ci-test-secret
|
|
DJANGO_ALLOWED_HOSTS: '*'
|
|
DJANGO_ALLOWED_ORIGINS: 'http://localhost'
|
|
DB_NAME: matitos
|
|
DB_USER: supermatitos
|
|
DB_PASSWORD: supermatitos
|
|
DB_HOST: localhost
|
|
DB_PORT: '5432'
|
|
REDIS_CACHE_HOST: localhost
|
|
REDIS_CACHE_PORT: '6379'
|
|
REDIS_CELERY_HOST: localhost
|
|
REDIS_CELERY_PORT: '6379'
|
|
PATH_LOGS_DIRECTORY: /tmp/logs
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
cache: 'pip'
|
|
cache-dependency-path: app_urls/requirements.txt
|
|
|
|
- name: Install dependencies
|
|
run: grep -v '^git+' app_urls/requirements.txt | pip install -r /dev/stdin
|
|
|
|
- name: Run tests
|
|
working-directory: app_urls
|
|
run: python manage.py test fetcher.tests -v 2
|