Skip to content

use uv and hatchling #749

use uv and hatchling

use uv and hatchling #749

Workflow file for this run

name: Tests
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- '*'
jobs:
julia:
name: Test (${{ matrix.os }}, julia ${{ matrix.jlversion }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
arch: [x64] # x86 unsupported by MicroMamba
os: [ubuntu-latest, windows-latest, macos-latest]
jlversion: ['1','1.6']
steps:
- uses: actions/checkout@v2
- name: Set up Julia ${{ matrix.jlversion }}
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.jlversion }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Build package
uses: julia-actions/julia-buildpkg@v1
- name: Run tests
uses: julia-actions/julia-runtest@v1
env:
JULIA_DEBUG: PythonCall
JULIA_NUM_THREADS: '2'
- name: Process coverage
uses: julia-actions/julia-processcoverage@v1
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
python:
name: Test (${{ matrix.os }}, python ${{ matrix.pyversion }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
pyversion: ["3.x", "3.8"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.pyversion }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyversion }}
- name: Set up Julia
uses: julia-actions/setup-julia@v1
with:
version: '1'
- name: Set up UV
uses: astral-sh/setup-uv@v2
- name: Use dev Julia dependencies
run: cp pysrc/juliacall/juliapkg-dev.json pysrc/juliacall/juliapkg.json
- name: Install dependencies
run: uv sync
- name: Lint with ruff
run: uv run ruff check
- name: Run tests
run: |
uv run pytest -s --nbval --cov=pysrc ./pytest/
env:
PYTHON_JULIACALL_THREADS: '2'
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}