Skip to content

[pre-commit.ci] pre-commit autoupdate #47

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #47

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: [master]
jobs:
test-and-publish-flow:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Run Poetry image
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.5.0
- name: Install library
run: poetry install --no-interaction
- name: Run tests
run: poetry run pytest
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v3
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# publish version only when pyproject.toml is changed in master
- name: Filter changes in pyproject
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
root:
- 'pyproject.toml'
- if: ${{ (github.ref == 'refs/heads/master') && (steps.changes.outputs.root == 'true')}}
name: Build and publish
env:
PYPI_USER: ${{ secrets.PYPI_USER }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: poetry publish --username $PYPI_USER --password $PYPI_PASSWORD --build