Skip to content

Linter fixes

Linter fixes #558

Workflow file for this run

name: Test on all platforms
on: [push, pull_request]
jobs:
tests:
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
python-version: 3.8
- os: windows-latest
python-version: 3.9
- os: windows-latest
python-version: "3.10"
- os: windows-latest
python-version: 3.11
- os: ubuntu-latest
python-version: 3.8
- os: ubuntu-latest
python-version: 3.9
- os: ubuntu-latest
python-version: "3.10"
- os: ubuntu-latest
python-version: 3.11
- os: macos-latest
python-version: 3.8
- os: macos-latest
python-version: 3.9
- os: macos-latest
python-version: "3.10"
- os: macos-latest
python-version: 3.11
steps:
- name: Checkout MPF
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install MPF
run: |
pip install --upgrade pip setuptools wheel build coveralls
pip install -e .
- name: Run tests
# Oct 15 2023, "coverage" randomly is not recognized as valid on windows
# even though you can see it being installed via pip (from coveralls)?!?
shell: bash # Need bash on windows to use the if statement
run: |
if [ "${{ runner.os }}" == "Windows" ]; then
python3 -m unittest discover -s mpf/tests
else
python3 -m coverage run -m unittest discover -s mpf/tests
fi
- name: Upload coverage data to coveralls.io
if: matrix.os != 'windows-latest'
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}-${{ matrix.os }}
COVERALLS_PARALLEL: true
coveralls:
name: Indicate completion to coveralls.io
needs: tests
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}