This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
[Tasks API] Implement task model view set #145
Workflow file for this run
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: Run CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
types: | |
- opened | |
- reopened | |
- synchronize | |
jobs: | |
analyze: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:13 | |
env: | |
POSTGRES_USER: ${{ secrets.PGUSER }} | |
POSTGRES_PASSWORD: ${{ secrets.PGPASSWORD }} | |
POSTGRES_DB: ${{ secrets.PGDATABASE }} | |
ports: | |
- "5432:5432" | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install poetry | |
poetry install --with dev --no-root | |
- name: Run tests and collect coverage | |
run: | | |
poetry run coverage run --source "." manage.py test | |
poetry run coverage xml | |
env: | |
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }} | |
PGHOST: ${{ secrets.PGHOST }} | |
PGPORT: ${{ secrets.PGPORT }} | |
PGUSER: ${{ secrets.PGUSER }} | |
PGPASSWORD: ${{ secrets.PGPASSWORD }} | |
PGDATABASE: ${{ secrets.PGDATABASE }} | |
- name: Upload coverage report artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage | |
path: ./coverage.xml | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
with: | |
args: | |
-Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} | |
-Dsonar.organization=${{ secrets.SONAR_ORGANIZATION_KEY }} | |
-Dsonar.python.coverage.reportPaths=coverage.xml -X | |
-Dsonar.coverage.exclusions=**/__init__*,**/tests/**,manage.py,**/asgi.py,**/wsgi.py -X | |
-Dsonar.cpd.exclusions=**/tests/** -X | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |