-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (60 loc) · 1.86 KB
/
insolver-tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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 Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip setuptools wheel
poetry install --extras "all" --with dev --no-interaction
- name: Lint with black
shell: bash
run: |
poetry run black . --check --line-length 120
- name: Lint with ruff
shell: bash
run: |
poetry run ruff check . --select=E9,F63,F7,F82 --show-source
poetry run ruff check . --exit-zero --statistics
- name: Test with pytest
shell: bash
run: |
poetry run 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
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true