xyb/robotframework-debuglibrary

View on GitHub
.github/workflows/test.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: test

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    name: py-${{ matrix.python-version }} rf-${{ matrix.robotframework-version }} ${{ matrix.platform }}
    runs-on: ${{ matrix.platform }}
    strategy:
      fail-fast: false
      matrix:
        python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
        robotframework-version: [4.1, 5.0, 6.1, 7.0]
        platform: [ubuntu-latest, macOS-latest]
    steps:
    - uses: actions/checkout@v4
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        python -m pip install setuptools
        pip install flake8
        pip install coverage
        pip install robotframework==${{ matrix.robotframework-version }}
    - name: Lint with flake8
      run: |
        flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=80 --statistics
    - name: Test
      run: |
        python setup.py develop
        python setup.py test
    - name: Generate coverage report
      run: |
        coverage xml
    - name: Send coverage report to codecov
      uses: codecov/codecov-action@v3
      with:
        file: ./coverage.xml
    - name: Send coverage report to codeclimate
      uses: paambaati/codeclimate-action@v5
      with:
        coverageCommand: echo "Ignore rerun"
        coverageLocations: ${{github.workspace}}/coverage.xml:coverage.py
      env:
        CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}