lib.itmens/.github/workflows/tests.yml

58 lines
1.4 KiB
YAML
Raw Normal View History

2023-10-22 18:02:15 -04:00
name: unit test
2022-12-16 09:53:06 -05:00
on:
push:
pull_request:
branches: [ "main" ]
jobs:
2023-07-20 21:59:49 -04:00
django:
2022-12-16 09:53:06 -05:00
runs-on: ubuntu-latest
services:
2023-05-22 20:14:14 -04:00
redis:
image: redis
ports:
- 6379:6379
2022-12-16 09:53:06 -05:00
db:
2023-07-20 21:59:49 -04:00
image: postgres
2022-12-16 09:53:06 -05:00
env:
2023-07-20 21:59:49 -04:00
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpass
POSTGRES_DB: test_neodb
2022-12-16 09:53:06 -05:00
ports:
- 5432:5432
2023-07-20 21:59:49 -04:00
db2:
image: postgres
env:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpass
POSTGRES_DB: test_neodb_takahe
ports:
- 15432:5432
2022-12-16 09:53:06 -05:00
strategy:
max-parallel: 4
matrix:
2024-06-01 10:24:17 -04:00
python-version: ['3.12']
2022-12-16 09:53:06 -05:00
steps:
2024-06-16 09:06:57 -04:00
- uses: actions/checkout@v4
2022-12-16 09:53:06 -05:00
- name: Set up Python ${{ matrix.python-version }}
2024-06-16 09:06:57 -04:00
uses: actions/setup-python@v5
2022-12-16 09:53:06 -05:00
with:
python-version: ${{ matrix.python-version }}
2023-08-11 01:43:19 -04:00
cache: pip
2022-12-16 09:53:06 -05:00
- name: Install Dependencies
run: |
2024-06-04 23:29:55 -04:00
pip install -r requirements.lock
sudo apt install -y gettext
2022-12-16 09:53:06 -05:00
- name: Run Tests
2023-09-25 19:47:46 +00:00
env:
NEODB_DB_URL: postgres://testuser:testpass@127.0.0.1/test_neodb
TAKAHE_DB_URL: postgres://testuser:testpass@127.0.0.1/test_neodb_takahe
NEODB_REDIS_URL: redis://127.0.0.1:6379/0
NEODB_SITE_NAME: test
NEODB_SITE_DOMAIN: test.domain
NEODB_SECRET_KEY: test
2022-12-16 09:53:06 -05:00
run: |
python manage.py compilemessages -i .venv -l zh_Hans
2023-01-11 09:26:58 -05:00
python manage.py test