Adapts Quill's work on batching for easy merging + CI changes #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
- name: Install pre-commit | |
run: | | |
pip install pre-commit | |
- name: Setup pre-commit hooks | |
run: | | |
pre-commit install | |
- name: Run pre-commit hooks | |
run: | | |
pre-commit run --all-files | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: | | |
3.11 | |
3.10 | |
3.9 | |
3.8 | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: pip install cvxpy diffcp pytest | |
- name: Run tests | |
run: pytest | |
- name: build | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
run: | | |
pip install --upgrade build | |
python -m build | |
- name: publish | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |