From fa2017628038b760f83b067043e4c2cce83027cd Mon Sep 17 00:00:00 2001 From: Omid Hashemzadeh Date: Sun, 18 May 2025 16:18:05 +0100 Subject: [PATCH 1/3] add deploy-coverage stage to ci.yml --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 096a39f..cdde8f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,12 +61,48 @@ jobs: source venv/bin/activate python manage.py migrate - - name: Run tests + - name: Run tests with coverage run: | source venv/bin/activate - pytest --disable-warnings + pytest --cov=. --cov-report=html - name: Run Ruff Linter run: | source venv/bin/activate ruff check . + + - name: Upload coverage html + uses: actions/upload-artifact@v4 + with: + name: htmlcov + path: htmlcov/ + + deploy-coverage: + needs: build-test-lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m venv venv + source venv/bin/activate + pip install -r requirements.txt + + - name: Generate HTML Coverage Report + run: | + source venv/bin/activate + pytest --cov=. --cov-report=html + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./htmlcov + publish_branch: gh-pages From a68fd7cf3f866d4d77c9adc04e22625a774fad77 Mon Sep 17 00:00:00 2001 From: Omid Hashemzadeh Date: Sun, 18 May 2025 16:24:11 +0100 Subject: [PATCH 2/3] fix ci.yml --- .github/workflows/ci.yml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cdde8f8..63ee36b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: source venv/bin/activate ruff check . - - name: Upload coverage html + - name: Upload coverage report uses: actions/upload-artifact@v4 with: name: htmlcov @@ -84,21 +84,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Download coverage artifact + uses: actions/download-artifact@v4 with: - python-version: '3.12' - - - name: Install dependencies - run: | - python -m venv venv - source venv/bin/activate - pip install -r requirements.txt - - - name: Generate HTML Coverage Report - run: | - source venv/bin/activate - pytest --cov=. --cov-report=html + name: htmlcov + path: htmlcov - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v4 From dcc49f3580afd620a6eafb6e3465e58a4874bb44 Mon Sep 17 00:00:00 2001 From: Omid Hashemzadeh Date: Sun, 18 May 2025 17:01:05 +0100 Subject: [PATCH 3/3] Fix readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9cb236e..157b2fe 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # 🧩 TaskFlow API +![Coverage Report](https://omidcodes.github.io/taskflow-api/index.html) + A Django RESTful API for managing personal or team tasks — featuring PostgreSQL, RabbitMQ, Celery, and Nginx in a Dockerized production setup. ---