Migration to joblib + new build system + separate reusable publish workflow #4
This file contains 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: scikit_mol ci | |
on: | |
push: | |
branches: [main] | |
tags: ['v*'] | |
pull_request: | |
branches: [main] | |
# cancel previously running tests if new commits are made | |
# https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix | |
concurrency: | |
group: actions-id-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
# run pytests for scikit_mol | |
tests: | |
name: pytest ${{ matrix.os }}::py${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 6 | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.10"] | |
include: | |
# test python version compatibility on linux only | |
- os: ubuntu-latest | |
python-version: 3.13 | |
- os: ubuntu-latest | |
python-version: 3.12 | |
- os: ubuntu-latest | |
python-version: 3.11 | |
- os: ubuntu-latest | |
python-version: 3.10 | |
- os: ubuntu-latest | |
python-version: 3.9 | |
steps: | |
- name: Checkout scikit_mol | |
uses: actions/checkout@v4 | |
- name: Install uv and set the python version | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install scikit_mol | |
run: uv sync --dev | |
- name: Cache tests/data | |
uses: actions/cache@v4 | |
with: | |
path: tests/data | |
key: ${{ runner.os }}-${{ hashFiles('tests/conftest.py') }} | |
- name: Run Tests | |
run: uv run pytest --cov=./scikit_mol . | |
publish: | |
name: Publish to PyPI with uv | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
needs: tests | |
uses: ./.github/workflows/publish.yaml | |
with: | |
python-version: "3.9" | |
is-draft: true | |
secrets: | |
pypi-password: ${{ secrets.pypi-password }} | |