This commit is contained in:
+12
-14
@@ -20,35 +20,33 @@ jobs:
|
||||
--health-timeout 5s
|
||||
--health-retries 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
cache: pip
|
||||
- uses: https://gitea.com/actions/checkout@v4
|
||||
- name: Show Python version
|
||||
run: python3 --version
|
||||
- name: Install MySQL build dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y default-libmysqlclient-dev pkg-config
|
||||
- name: Install dependencies
|
||||
run: pip install -r requirements-dev.txt
|
||||
run: python3 -m pip install -r requirements-dev.txt
|
||||
- name: Check migrations
|
||||
working-directory: backend
|
||||
run: python manage.py makemigrations --check --dry-run
|
||||
run: python3 manage.py makemigrations --check --dry-run
|
||||
- name: Django checks
|
||||
working-directory: backend
|
||||
run: python manage.py check
|
||||
run: python3 manage.py check
|
||||
- name: ASGI import check
|
||||
working-directory: backend
|
||||
run: python -c "from config.asgi import application; print(type(application).__name__)"
|
||||
run: python3 -c "from config.asgi import application; print(type(application).__name__)"
|
||||
- name: Unit tests
|
||||
run: pytest -q
|
||||
run: python3 -m pytest -q
|
||||
- name: MySQL migrations and tests
|
||||
env:
|
||||
DATABASE_URL: mysql://root:ci-root-password@mysql:3306/hulumath
|
||||
run: |
|
||||
python backend/manage.py check --database default
|
||||
python backend/manage.py check_mysql
|
||||
python backend/manage.py migrate --noinput
|
||||
pytest -q
|
||||
python3 backend/manage.py check --database default
|
||||
python3 backend/manage.py check_mysql
|
||||
python3 backend/manage.py migrate --noinput
|
||||
python3 -m pytest -q
|
||||
- name: Build image
|
||||
run: docker build -t hulumath:${{ gitea.sha }} .
|
||||
|
||||
Reference in New Issue
Block a user