[init] project

This commit is contained in:
Data-Name-ID
2024-04-02 00:51:49 +03:00
commit 52233d0028
28 changed files with 685 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
name: Django CI/CD
on: [push, pull_request]
jobs:
migrations:
runs-on: ubuntu-latest
env:
DJANGO_DEBUG: True
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install production dependencies
run: pip install -r backend/requirements/prod.txt
- name: Check for pending migrations
run: cd backend/project && python manage.py makemigrations --check --dry-run
linting:
runs-on: ubuntu-latest
needs: migrations
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install linting dependencies
run: pip install -r backend/requirements/dev.txt
- name: Lint with ruff
run: cd backend && ruff check .
testing:
runs-on: self-hosted
needs: linting
env:
DJANGO_DEBUG: True
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install test dependencies
run: pip install -r backend/requirements/test.txt
- name:
run: cd backend/project && python manage.py test
test_build:
runs-on: ubuntu-latest
needs: testing
steps:
- uses: actions/checkout@v3
- name: Build Docker image
run: docker build -t skillhub_backend backend/