Skip to content

fix(serialization): Fix enable/disable defaults #34

fix(serialization): Fix enable/disable defaults

fix(serialization): Fix enable/disable defaults #34

Workflow file for this run

name: Main pipeline
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
jobs:
validate:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10" ]
env:
POETRY_HOME: /opt/poetry
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Check Python version
run: python --version
- name: Install poetry
run: |
python -m venv $POETRY_HOME
$POETRY_HOME/bin/pip install "poetry~=1.7.1"
$POETRY_HOME/bin/poetry --version
- name: Install package
run: |
$POETRY_HOME/bin/poetry install --with dev
- name: Validate
run: |
$POETRY_HOME/bin/poetry run ruff check
$POETRY_HOME/bin/poetry run ruff format --check
$POETRY_HOME/bin/poetry run mypy src/ tests/
- name: Run tests
run: |
$POETRY_HOME/bin/poetry run pytest tests/
build-and-publish:
needs: validate
# Only run if it's on main branch.
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
env:
POETRY_HOME: /opt/poetry
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Check Python version
run: python --version
- name: Install poetry
run: |
python -m venv $POETRY_HOME
$POETRY_HOME/bin/pip install "poetry~=1.7.1"
$POETRY_HOME/bin/poetry --version
- name: Install package
run: |
$POETRY_HOME/bin/poetry install --with dev
- name: Validate
run: |
$POETRY_HOME/bin/poetry run ruff check
$POETRY_HOME/bin/poetry run ruff format --check
$POETRY_HOME/bin/poetry run mypy src/ tests/
- name: Run tests
run: |
$POETRY_HOME/bin/poetry run pytest tests/
- name: Build
run: |
$POETRY_HOME/bin/poetry build
- name: Publish to PyPI
run: |
$POETRY_HOME/bin/poetry publish -u __token__ -p $PYPI_API_TOKEN