Skip to content

Use venv in github actions #341

Use venv in github actions

Use venv in github actions #341

Workflow file for this run

name: Django Drip Campaigns
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
include:
# # python 3.5
# - python-version: "3.5"
# django-version: "2.2"
# python 3.6
# - python-version: "3.6"
# django-version: "2.2"
# - python-version: "3.6"
# django-version: "3.2"
# python 3.7
# - python-version: "3.7"
# django-version: "2.2"
# - python-version: "3.7"
# django-version: "3.2"
# python 3.8
- python-version: "3.8"
django-version: "2.2"
- python-version: "3.8"
django-version: "3.2"
- python-version: "3.8"
django-version: "4.2"
# python 3.9
- python-version: "3.9"
django-version: "2.2"
- python-version: "3.9"
django-version: "3.2"
- python-version: "3.9"
django-version: "4.2"
# # python 3.10
# - python-version: "3.10"
# django-version: "2.2"
# - python-version: "3.10"
# django-version: "3.2"
# - python-version: "3.10"
# django-version: "4.2"
# - python-version: "3.10"
# django-version: "5.2"
# # python 3.11
# - python-version: "3.11"
# django-version: "2.2"
# - python-version: "3.11"
# django-version: "3.2"
# - python-version: "3.11"
# django-version: "4.2"
# - python-version: "3.11"
# django-version: "5.2"
# # python 3.12
# - python-version: "3.12"
# django-version: "2.2"
# - python-version: "3.12"
# django-version: "3.2"
# - python-version: "3.12"
# django-version: "4.2"
# - python-version: "3.12"
# django-version: "5.2"
# # pypy3
# - python-version: "pypy3"
# django-version: "2.2"
# - python-version: "pypy3"
# django-version: "3.2"
# - python-version: "pypy3"
# django-version: "4.2"
# - python-version: "pypy3"
# django-version: "5.2"
runs-on: ubuntu-20.04
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
steps:
- uses: actions/checkout@v2
- name: Set up Python version ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Installing resources
run: pip install --upgrade pip
- name: Installing and entering to virtualenv
run: |
pip install virtualenv
python -m venv venv
source venv/bin/activate
- name: Installing Requirements
run: pip install -r requirements.txt
- name: Checking PEP8 code style
run: flake8 .
- name: Checking Black code formatter
run: black . --check
- name: Check typing
run: mypy --namespace-packages --explicit-package-bases --ignore-missing-imports --no-warn-unused-ignores .
- name: Running tests
run: coverage run -m pytest --ds=testsettings
- name: Checking coverage
run: |
coverage report --fail-under=90 -m
coverage xml
- name: Setup Code Climate test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
./cc-test-reporter after-build --coverage-input-type coverage.py --exit-code $?