50 lines
1.0 KiB
YAML
50 lines
1.0 KiB
YAML
name: Django CI Pipeline
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- release
|
|
- testing-pipeline
|
|
|
|
jobs:
|
|
test:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
env:
|
|
SECRET_KEY: "t3st_dummy_s3cr3t_k3y"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install python3-venv
|
|
id: install
|
|
run: |
|
|
apt-get update
|
|
apt-get install python3 python3-venv python3-pip -y
|
|
|
|
- name: Check Python version
|
|
run: |
|
|
python3 --version
|
|
|
|
- name: Create virtual environment
|
|
run: |
|
|
python3 -m venv venv
|
|
source venv/bin/activate
|
|
echo "Virtual environment created successfully"
|
|
# https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context
|
|
if: steps.install.outcome == 'success'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
source venv/bin/activate
|
|
pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Run tests
|
|
run: |
|
|
source venv/bin/activate
|
|
python3 manage.py test
|
|
|