add fit method #28
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: Test | |
on: [push, pull_request] | |
jobs: | |
test: | |
name: ${{ matrix.os }} / ${{ matrix.python-version }} | |
runs-on: ${{ matrix.image }} | |
strategy: | |
matrix: | |
# os: [Ubuntu, Windows, macOS] | |
os: [Ubuntu] | |
python-version: ["3.9", "3.10"] | |
include: | |
- os: Ubuntu | |
image: ubuntu-latest | |
# - os: Windows | |
# image: windows-2022 | |
# - os: macOS | |
# image: macos-12 | |
fail-fast: false | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get full Python version | |
id: full-python-version | |
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT | |
- name: Install and configure Poetry | |
run: | | |
pip install poetry | |
poetry --version | |
poetry config virtualenvs.in-project true | |
- name: Cache the virtualenv | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install project dependencies | |
run: | | |
poetry install --with dev | |
- name: Run tests and collect coverage | |
run: | | |
poetry run pytest --cov -v -s --cov-report=xml | |
- name: Upload coverage to Codecov | |
if: ${{ matrix.python-version == '3.10' }} | |
uses: codecov/codecov-action@v3 | |
with: | |
verbose: true |