ci(pre-commit.ci): autoupdate #76
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: tests | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*" | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
check-manifest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: pipx run check-manifest | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: 🛑 Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
mamba-version: "*" | |
auto-update-conda: true | |
activate-environment: test | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge | |
- name: Install dependencies | |
run: | | |
mamba install -y pyopencl pocl | |
python -m pip install -U pip | |
python -m pip install -e .[test] | |
- name: Test | |
run: pytest -v --cov=./ --cov-report=xml | |
- name: Coverage | |
uses: codecov/codecov-action@v4 | |
deploy: | |
needs: [test] | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install -U pip | |
python -m pip install build | |
python -m build | |
- name: 🚢 Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TWINE_API_KEY }} | |
- uses: softprops/action-gh-release@v2 | |
with: | |
generate_release_notes: true |