aymanizz/smalld-click

View on GitHub
.github/workflows/coverage.yml

Summary

Maintainability
Test Coverage
name: Coverage

on:
  push:
    branches: [ master ]

jobs:
  coverage:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Install pyenv dependencies
      run: > 
        sudo apt-get update &&
        sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev
        libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev
        xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
    - name: setup pyenv
      uses: "gabrielfalcao/pyenv-action@v5"
      with:
        default: 3.8.0
        versions: 3.6.9, 3.7.4
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install tox
    - name: Install code climate reporter
      run: |
        curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
        chmod +x ./cc-test-reporter
    - name: Test with tox
      run: |
        pyenv local 3.6.9 3.7.4 3.8.0
        ./cc-test-reporter before-build
        tox --skip-missing-interpreters=false
        ./cc-test-reporter after-build --coverage-input-type coverage.py --exit-code $?
      env:
        CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_REPORTER_ID }}