Skip to content

Fix CI: trigger on tag push for PyPI publishing, bump 0.1.9 (#2) #20

Fix CI: trigger on tag push for PyPI publishing, bump 0.1.9 (#2)

Fix CI: trigger on tag push for PyPI publishing, bump 0.1.9 (#2) #20

Workflow file for this run

name: CI
on:
push:
branches: [master]
tags: ['v*']
pull_request:
branches: [master]
env:
JAX_ENABLE_X64: "1"
jobs:
version-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Check version bump
run: |
pip install packaging tomli
python scripts/check_version.py
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Lint
run: ruff check jaxwavelets/
- name: Format check
run: ruff format --check jaxwavelets/
- name: Test with coverage
run: |
pip install pytest-cov
pytest jaxwavelets/tests/ --cov=jaxwavelets --cov-report=xml --cov-report=term-missing -v --tb=short
- name: Upload coverage
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
build:
needs: [version-check, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build and check
run: |
pip install build twine
python -m build
twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
publish:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1