From feea8952fb9964535eac42b8ee74688f6c702caf Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Thu, 18 Jul 2024 11:55:58 +0200 Subject: [PATCH] Update GHA workflows (#228) --- .github/workflows/release.yml | 33 +++++++++------------------------ .github/workflows/test.yml | 29 +++++++---------------------- 2 files changed, 16 insertions(+), 46 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8885514..02662477 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -18,52 +15,44 @@ 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 @@ -71,8 +60,4 @@ jobs: pattern: artifact-* merge-multiple: true path: dist - - uses: pypa/gh-action-pypi-publish@v1.9.0 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e10604b..8fc3911e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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 }}