MarcoAndreaBuchmann/bme280pi

View on GitHub
.github/workflows/coverage.yml

Summary

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

name: Coverage

on: ["push", "pull_request"]

jobs:
  build:

    name: Coverage
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: 3.8
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install pytest coverage
        python setup.py develop
    - name: Install CodeClimate Test Reporter
      run: |
        curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
        chmod +x ./cc-test-reporter
    - name: Run coverage
      env:
        CODE_CLIMATE_SECRET: ${{ secrets.CODE_CLIMATE_SECRET }}
      run: |
        ./cc-test-reporter before-build
        coverage run --include=bme280pi/* -m pytest test/*
        coverage xml
        ./cc-test-reporter after-build --exit-code $? --coverage-input-type coverage.py -r ${CODE_CLIMATE_SECRET}