Update workflow #117
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: Insolver testing | |
on: | |
push: | |
branches: [master, dev] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
isDev: | |
- ${{ contains(github.ref, 'dev') }} | |
exclude: | |
- isDev: true | |
os: windows-latest | |
- isDev: true | |
os: macos-latest | |
runs-on: ${{ matrix.os }} | |
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 libomp for lightgbm (macOS) | |
if: matrix.os == 'macos-latest' | |
run: brew install libomp | |
- name: Install dependencies | |
shell: bash | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install wheel ruff pytest pytest-cov black[jupyter] | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Lint with black | |
shell: bash | |
run: | | |
black . --check --line-length 120 | |
- name: Lint with ruff | |
shell: bash | |
run: | | |
ruff check . --select=E9,F63,F7,F82 --show-source | |
ruff check . --exit-zero --statistics | |
- name: Test with pytest | |
shell: bash | |
run: | | |
python -m pytest --cov=insolver --cov-report xml | |
- name: Code coverage with codecov on (ubuntu-latest & Python 3.10 & master) | |
if: | | |
(matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' && github.ref == 'refs/heads/master') | |
uses: codecov/codecov-action@v4 | |
with: | |
flags: unittests | |
name: codecov-insolver | |
fail_ci_if_error: false | |
files: ./coverage.xml |