Skip to content

Instantly share code, notes, and snippets.

@omonimus1
Last active May 13, 2022 08:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omonimus1/e42fd5154f7ebd620e1188168a7c9b2f to your computer and use it in GitHub Desktop.
Save omonimus1/e42fd5154f7ebd620e1188168a7c9b2f to your computer and use it in GitHub Desktop.
Pepeline for django Project
name: Testing and Coverage
on:
push:
branches: [ develop, master, staging ]
pull_request:
branches: [ develop, master, staging ]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 12
environment:
name: development
strategy:
max-parallel: 4
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements/testing.txt
- uses: codecov/codecov-action@v2
- name: Run Tests and Upload coverage testing
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
DEBUG: ${{ secrets.DEBUG }}
DATABASE_HOST: ${{ secrets.DATABASE_HOST }}
DATABASE_NAME: ${{ secrets.DATABASE_NAME }}
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
DATABASE_USER: ${{ secrets.DATABASE_USER }}
DATABASE_PORT: ${{ secrets.DATABASE_PORT }}
HOST: ${{ secrets.HOST }}
run: |
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py test
pytest --cov --cov-report xml .
codecov -t ${{ secrets.CODECOV_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment