Skip to content

5 custom model training #44

5 custom model training

5 custom model training #44

Workflow file for this run

name: Main Workflow
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
release:
types: [published]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true
- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install dependencies
run: |
poetry install --with dev
- name: Run prepare script
run: |
poetry run prepare
- name: Run ruff check
run: |
poetry run ruff check .
- name: Run ruff format check
run: |
poetry run ruff format --check .
- name: Run mypy check
run: |
poetry run mypy .
- name: Run tests
run: |
poetry run python -m unittest discover tests
publish:
needs: [test]
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true
- name: Install dependencies
run: |
poetry install --no-dev
- name: Run prepare script
run: |
poetry run prepare
- name: Build and publish to PyPI
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry publish --build