ChrisRBe/PP-P2P-Parser

View on GitHub
.github/workflows/integration.yml

Summary

Maintainability
Test Coverage
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Integration

on:
  push:
    branches: [ master, staging, trying ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.8", "3.9", "3.10", "3.11"]

    steps:
    - uses: actions/checkout@v3
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -U pipenv
        pipenv install --system --skip-lock --dev --site-packages
    - name: Install additional locale
      run: |
        sudo apt-get update && sudo apt-get install tzdata locales -y && sudo locale-gen de_DE.UTF-8
        sudo update-locale
        echo "Testing language settings"
        echo "All languages..."
        locale -a
        echo "Actual locale"
        locale
        echo "Actual numeric settings"
        locale -c -k LC_NUMERIC
    - name: Format with black
      run: |
        black -l 119 --check --diff .
    - name: Lint with flake8
      run: |
        # stop the build if there are Python syntax errors or undefined names
        flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
        # exit-zero treats all errors as warnings.
        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=119 --statistics
    - name: Code Climate Coverage Action
      uses: paambaati/codeclimate-action@v3.2.0
      env:
        CC_TEST_REPORTER_ID: 9fbcedc83021dae40df55ed23b48c4eb2a5b0b3a41047097e283c5df385e0b16
      with:
        coverageCommand: |
          pytest -v --doctest-modules --cov=src --cov-report=xml --junit-xml=pytest-result-${{ matrix.python-version }}.xml
        coverageLocations: 'coverage.xml:coverage.py'
        debug: true