make the expensive build only run on release. add quick uv test #1
This file contains hidden or 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: Quick build and test | |
| on: push | |
| jobs: | |
| test: | |
| name: Test with UV | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| run: uv python install | |
| - name: Install the project | |
| run: uv sync --group dev | |
| - name: Run tests | |
| run: uv run pytest | |
| build_wheels: | |
| name: Build wheels on ubuntu only | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.3.1 | |
| env: | |
| CIBW_SKIP: "*musllinux*" | |
| CIBW_TEST_REQUIRES: pytest | |
| CIBW_TEST_COMMAND: "pytest {project}/tests" | |
| CIBW_ARCHS: auto64 | |
| # CIBW_ARCHS_MACOS: "x86_64 universal2" | |
| # CIBW_ARCHS_WINDOWS: auto64 | |
| # CIBW_ARCHS_LINUX: auto64 | |
| # CIBW_TEST_SKIP: "cp311*" due to scipy not finding openblas to build from source. may be removed when 311 released. | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
| path: ./wheelhouse/*.whl | |
| make_sdist: | |
| name: Make SDist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # Optional, use if you use setuptools_scm | |
| submodules: true # Optional, use if you have submodules | |
| - name: Build SDist | |
| run: pipx run build --sdist | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: cibw-sdist | |
| path: dist/*.tar.gz | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true |