Skip to content

Build, test & publish #1178

Build, test & publish

Build, test & publish #1178

Workflow file for this run

name: Build, test & publish
on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
cache-dependency-path: dev-requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
- uses: pre-commit/action@v3.0.0
env:
SKIP: pytest
- name: set pythonpath
run: |
echo "PYTHONPATH=${PYTHONPATH}:${PWD}/src" >> $GITHUB_ENV
- name: Test with pytest
run: |
pytest
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1