Skip to content

0.6.0 Rewrite

0.6.0 Rewrite #18

Workflow file for this run

name: CI
on:
push:
branches:
- master
- main
- uv-cleanup
pull_request:
branches:
- main
- master
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13']
steps:
- name: Checkout Code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.7.6"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --extra all
- name: Cache HF niftis dataset
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/huggingface
key: hf-cache-${{ runner.os }}-${{ hashFiles('nltools/templates/fetch.py') }}
restore-keys: |
hf-cache-${{ runner.os }}-
- name: Lint with ruff
run: uv run ruff check nltools/
- name: Run tests
env:
HF_HUB_ETAG_TIMEOUT: "30"
run: uv run pytest -n 2 --tb=short
- name: Build docs
if: matrix.python-version == '3.12'
run: uv run jupyter-book build docs
- name: Build package
if: matrix.python-version == '3.12'
run: uv build
pyodide:
name: Pyodide smoke tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout Code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.7.6"
- name: Set up Python
run: uv python install 3.12
- name: Set up Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
cache: "npm"
cache-dependency-path: nltools/tests/pyodide/package.json
- name: Build wheel
run: uv build --wheel
- name: Install pyodide npm package
working-directory: nltools/tests/pyodide
run: npm install --silent
- name: Cache Pyodide runtime wheels
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: nltools/tests/pyodide/node_modules/pyodide
key: pyodide-${{ runner.os }}-${{ hashFiles('nltools/tests/pyodide/package.json') }}
- name: Run Pyodide smoke tests
working-directory: nltools/tests/pyodide
run: node test_runner.mjs