From 073651986f96d922ef8f99539f66b2aafe689fe6 Mon Sep 17 00:00:00 2001 From: Jayaram Kancherla Date: Thu, 12 Dec 2024 17:40:56 -0800 Subject: [PATCH] sync actions with mattress --- .github/workflows/pypi-publish.yml | 32 +++++++++++++-------------- .github/workflows/pypi-test.yml | 35 +++++++----------------------- 2 files changed, 24 insertions(+), 43 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index bdbd3d9..6b2f949 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -22,8 +22,9 @@ jobs: CIBW_MUSLLINUX_X86_64_IMAGE: ghcr.io/artifactdb/prebuilt-hdf5/musllinux_x86_64:0.0.4 CIBW_SKIP: pp* - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-wheels-ubuntu-x86_64 path: ./wheelhouse/*.whl build_macosx_x86_64: @@ -48,13 +49,14 @@ jobs: CIBW_SKIP: pp* MACOSX_DEPLOYMENT_TARGET: 11.7 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-wheels-macos-x86_64 path: ./wheelhouse/*.whl build_macosx_arm64: name: Build wheels for macosx arm64 - runs-on: macos-13 + runs-on: macos-latest steps: - name: Check out repository uses: actions/checkout@v4 @@ -73,8 +75,9 @@ jobs: CIBW_BUILD_VERBOSITY: 3 MACOSX_DEPLOYMENT_TARGET: 13.0 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-wheels-maxos_arm64 path: ./wheelhouse/*.whl # build_windows_x86_64: @@ -107,10 +110,9 @@ jobs: # CIBW_TEST_EXTRAS: "testing" # CIBW_TEST_COMMAND: "pytest {package}/tests" # CIBW_BUILD_VERBOSITY: 3 - - - uses: actions/upload-artifact@v3 - with: - path: ./wheelhouse/*.whl + # - uses: actions/upload-artifact@v3 + # with: + # path: ./wheelhouse/*.whl build_sdist: name: Build source distribution @@ -123,24 +125,22 @@ jobs: - name: Build sdist run: pipx run build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-sdist path: dist/*.tar.gz upload_pypi: needs: [build_linux_x86_64, build_macosx_x86_64, build_macosx_arm64, build_sdist] runs-on: ubuntu-latest - # upload to PyPI on every tag starting with 'v' - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - # unpacks default artifact into dist/ - # if `name: artifact` is omitted, the action will create extra parent dir - name: artifact + pattern: cibw-* path: dist + merge-multiple: true - - uses: pypa/gh-action-pypi-publish@v1.8.3 + - uses: pypa/gh-action-pypi-publish@v1.12.2 with: user: __token__ password: ${{ secrets.PYPI_PASSWORD }} diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index d8596af..e583020 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -1,51 +1,32 @@ -name: Run unit tests +name: Test the library on: push: - branches: [ master ] + branches: + - master pull_request: - branches: [ master ] jobs: test: - runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] name: Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v4 - with: - submodules: true - - name: Set up Python ${{ matrix.python-version }} + - name: Setup Python uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: 'pip' + cache: "pip" - - name: Install Python dependencies - run: | - python -m pip install --upgrade pip setuptools - DEPENDENCIES=$(python -c 'from setuptools.config.setupcfg import read_configuration as c; a = c("setup.cfg"); print(" ".join(a["options"]["install_requires"][1:] + a["options"]["extras_require"]["testing"][1:]))') - pip install ${DEPENDENCIES} pybind11 + - name: Get latest CMake + uses: lukka/get-cmake@latest - # We do proper tests if we're on the master branch, or if we're creating a new release. - name: Test with tox - if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') run: | pip install tox tox - - # Otherwise we do some cached builds and tests for faster merging of PRs. - - name: Set up ccache - if: github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/tags') - uses: hendrikmuhs/ccache-action@v1.2 - - - name: Quickly build and test - if: github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/tags') - run: | - CC="ccache gcc" python setup.py install - pytest