Skip to content

0.0.3

0.0.3 #14

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches:
- main
schedule:
- cron: '00 6 1 * *'
release:
types:
- published
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install .[dev]
- name: Run Main code Lint
run: pylint src/pytito
- name: Install dependencies for unit tests
run: |
python -m pip install .[unit_tests]
- name: Run unit tests Lint
run: pylint tests/unit_tests
- name: Install dependencies for unit tests
run: |
python -m pip install .[integration_tests] -U
- name: Run integration tests Lint
run: pylint tests/integration_tests
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install .[dev]
- name: Type Check
run: mypy src/pytito
unit_tests:
needs:
- mypy
- lint
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.9, "3.10", "3.11", "3.12", "3.13" ]
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 dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[unit_tests]
- name: Run Unit Tests
run: |
pytest tests/unit_tests
integration_tests:
needs:
- unit_tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.9, "3.10", "3.11", "3.12", "3.13" ]
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 dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[integration_tests]
- name: Run Integration Tests
env:
TITO_API_KEY: ${{ secrets.TITO_API_KEY }}
run: |
pytest tests/integration_tests
#-------------------------------------------------------------------------------
build:
needs:
- integration_tests
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install -U build
- name: Build
run: python -m build
- uses: actions/upload-artifact@v4
with:
path: |
dist/*.tar.gz
dist/*.whl
#-------------------------------------------------------------------------------
deploy:
needs:
- build
runs-on: ubuntu-latest
# Only publish when a GitHub Release is created.
if: github.event_name == 'release'
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}