Merge pull request #20 from tomicapretto/modernize_package #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
name: Run tests with Python ${{ matrix.python-version }} | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dev environment & flexitext | |
shell: bash -l {0} | |
run: | | |
python -m pip install --upgrade pip | |
pip install . | |
pip install .[dev] | |
pip freeze | |
- name: Run linters | |
shell: bash -l {0} | |
run: | | |
python -m black -l 100 flexitext --check | |
echo "Success!" | |
echo "Checking code style with pylint..." | |
python -m pylint flexitext/ | |
- name: Run tests | |
shell: bash -l {0} | |
run: | | |
python -m pytest -vv --cov=flexitext --cov-report=term --cov-report=xml flexitext/tests | |
env: | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
env_vars: OS,PYTHON | |
name: codecov-umbrella | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: false |