Skip to content

Fix workflows, Readme, and add dummy/sample data (data seed) #38

Fix workflows, Readme, and add dummy/sample data (data seed)

Fix workflows, Readme, and add dummy/sample data (data seed) #38

name: Django CI
on:
push:
branches: [ "main", "staging" ]
pull_request:
branches: [ "main", "staging" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v3
- 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
- name: Run Tests
run: |
python manage.py test
sonarcloud:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install coverage
- name: Run tests and generate coverage
run: |
coverage run --source='.' manage.py test
coverage report > coverage-out.txt
coverage xml -o ./coverage.xml
echo "Test coverage result: $(cat coverage-out.txt)" >> Readme.md
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}