Skip to content

fix ci

fix ci #227

Workflow file for this run

name: ci
on: push
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
env:
MINIMUM_COVERAGE_PERCENTAGE: 100
strategy:
fail-fast: false
matrix:
python_version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: install dependencies
run: python3 -m pip install .[dev]
# - name: reformat # neccessary to fix 100% coverage
# run: |
# autopep8 --in-place --aggressive --aggressive pipe21.py
# black pipe21.py
- name: test
# run: pytest --cov pipe21 --cov-fail-under=${{ env.MINIMUM_COVERAGE_PERCENTAGE }}
run: pytest
- name: doctest
run: python3 -m doctest docs/reference.md
- name: pre-commit
run: pre-commit run --all-files
# - name: Upload coverage data to coveralls.io
# run: coveralls --service=github
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# COVERALLS_FLAG_NAME: ${{ matrix.python_version }}
# COVERALLS_PARALLEL: true
# coveralls:
# name: Indicate completion to coveralls.io
# needs: test
# runs-on: ubuntu-latest
# container: python:3-slim
# steps:
# - name: Finished
# run: |
# pip3 install --upgrade coveralls
# coveralls --service=github --finish
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-to-pypi-and-github-release:
if: "startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install pypa/build
run: python -m pip install --upgrade setuptools build twine
- name: Build a source tarball and wheel
run: python -m build .
- name: Upload to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: python -m twine upload dist/*
- name: Github Release
uses: softprops/action-gh-release@v1
mkdocs-github-pages:
if: "!startsWith(github.ref, 'refs/tags/')"
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.12
- uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: .cache
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force