Skip to content

Finally working

Finally working #624

Workflow file for this run

name: CI build
on:
push:
branches:
- "**"
tags:
- "v*"
jobs:
build:
name: Build on ${{ matrix.os }} using Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install machine
run: poetry install --no-interaction
- name: Lint with Black
run: poetry run black . --check --diff
- name: Lint with Flake8
run: poetry run flake8 . --statistics --show-source
- name: Lint with isort
run: poetry run isort . --check-only
- name: Setup Node for pyright
uses: actions/setup-node@v3
with:
node-version: "12"
- name: Lint with pyright
run: |
npm install -g [email protected]
poetry run pyright
- name: Test with pytest
run: poetry run pytest --cov --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
publish:
name: Create Wheel
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Build
run: poetry build
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: wheel
path: dist/*.whl
- name: Publish
if: startsWith(github.ref, 'refs/tags/v')
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry publish