Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GHA workflows #228

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 9 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ name: Release
on:
release:
types: [published]
workflow_dispatch:
# allow manual runs on branches without a PR


jobs:
pre-commit:
name: Pre-commit checks
style:
name: Check style
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -18,61 +15,49 @@ jobs:
python-version: '3.12'
- uses: pre-commit/action@v3.0.1


build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

needs: style
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-14]

name: Build wheels (${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Build wheels
- name: Build wheels and run tests
uses: pypa/cibuildwheel@v2.19.2

- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.os }}
path: ./wheelhouse/*.whl


build_sdist:
needs: style
name: Build source distribution
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: 3.12

- name: Build sdist
run: |
python -m pip install build numpy
python -m build --sdist

- uses: actions/upload-artifact@v4
with:
name: artifact-sdist
path: dist/*.tar.gz


upload_pypi:
upload-pypi:
name: Upload to PyPI
needs: [pre-commit, build_wheels, build_sdist]
needs: [style, build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: artifact-*
merge-multiple: true
path: dist

- uses: pypa/gh-action-pypi-publish@v1.9.0
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
29 changes: 7 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
name: Test

on:
push:
branches:
- main
pull_request:
paths-ignore:
- 'doc/**'
workflow_dispatch:
# allow manual runs on branches without a PR

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

- 'docs/**'

jobs:
pre-commit:
name: Pre-commit checks
style:
name: Check style
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -26,22 +16,17 @@ jobs:
python-version: '3.12'
- uses: pre-commit/action@v3.0.1


test:
needs: [pre-commit]
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

needs: style
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-14]

name: Run tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Build wheels and run pytest
- name: Build wheels and run tests
uses: pypa/cibuildwheel@v2.19.2

- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.os }}
Expand Down