fga-eps-mds/2020.2-Hortum

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
name: CI
on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: actions/setup-python@v2
        with:
          python-version: 3.x
      - name: Install dependencies for flake8
        run: |
          python -m pip install --upgrade pip
          pip install flake8
      - name: Lint with flake8
        run: |
          flake8 --extend-ignore=E302,E101,E131,W191,W293,W292 --count --select=E9,F63,F7,F82 --exclude=*.pyc,*migrations* --show-source --statistics src/
          flake8 --extend-ignore=E302,E101,E131,W191,W293,W292 --count --max-complexity=10 --max-line-length=226 --exclude=*.pyc,*migrations* --statistics src/
      - name: Create test environment
        run: docker-compose up -d --build
      - name: Run coverage tests
        run: docker exec 20202-hortum_web_1 bash -c "coverage run manage.py test && coverage report -m && coverage xml -o cov.xml"
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v1.0.2
        with:
          token: ${{secrets.CODECOV_TOKEN}}
          file: ./src/cov.xml
          flags: unittests
          name: codecov-umbrella