2024-01-04 20:07:57 +00:00
|
|
|
name: Django CI Pipeline
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- release
|
|
|
|
- testing-pipeline
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
2024-01-04 20:29:26 +00:00
|
|
|
runs-on: ubuntu-latest
|
2024-01-04 20:07:57 +00:00
|
|
|
|
|
|
|
steps:
|
2024-01-04 20:20:32 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-01-04 20:07:57 +00:00
|
|
|
|
2024-01-04 20:38:21 +00:00
|
|
|
- name: Install Python
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install python3 python3-venv python3-pip -y
|
|
|
|
|
|
|
|
- name: Check Python Version
|
|
|
|
run: |
|
|
|
|
python3 --version
|
2024-01-04 20:07:57 +00:00
|
|
|
|
|
|
|
- name: Create virtual environment
|
|
|
|
run: |
|
|
|
|
python -m venv venv
|
|
|
|
source venv/bin/activate
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
pip install --upgrade pip
|
|
|
|
pip install -r requirements.txt
|
|
|
|
|
|
|
|
- name: Run makemigrations
|
|
|
|
run: |
|
|
|
|
source venv/bin/activate
|
|
|
|
python manage.py makemigrations
|
|
|
|
|
|
|
|
- name: Run migrate
|
|
|
|
run: |
|
|
|
|
source venv/bin/activate
|
|
|
|
python manage.py migrate
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
source venv/bin/activate
|
|
|
|
python manage.py test
|
|
|
|
|