Merge pull request #5 from Horlawhumy-dev/add-task-filter #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Pipeline | |
on: | |
push: | |
branches: [ "main", "develop"] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.8, 3.9] | |
services: | |
postgres: | |
image: postgres:13 | |
env: | |
POSTGRES_DB: task_management | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: 12Facebook@6 | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd "pg_isready -U postgres" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
working-directory: task_management/backend | |
- name: Wait for Postgres | |
run: | | |
until nc -z localhost 5432; do | |
sleep 1 | |
done | |
- name: Create .env file | |
run: | | |
echo "SECRET_KEY=django-insecure-qp^%@n77+ydr-auroxk&zcg&xhj2x4+&3@f+!s3+m9ss*cez3j" >> .env | |
echo "DEBUG=False" >> .env | |
echo "POSTGRES_DB=task_management" >> .env | |
echo "POSTGRES_USER=postgres" >> .env | |
echo "POSTGRES_PASSWORD=12Facebook@6" >> .env | |
echo "POSTGRES_HOST=localhost" >> .env | |
echo "POSTGRES_PORT=5432" >> .env | |
working-directory: task_management/backend | |
- name: Apply Migrations and Run Tests | |
run: | | |
python manage.py migrate | |
python manage.py test | |
working-directory: task_management/backend |