|
12 | 12 |
|
13 | 13 | jobs: |
14 | 14 | julia: |
15 | | - name: Test (${{ matrix.os }}, julia ${{ matrix.jlversion }}) |
| 15 | + name: Test Julia (${{ matrix.jlversion }}, ${{ matrix.os }}, ${{ matrix.pythonexe }}) |
16 | 16 | runs-on: ${{ matrix.os }} |
17 | 17 | strategy: |
18 | | - fail-fast: true |
| 18 | + fail-fast: false |
19 | 19 | matrix: |
20 | 20 | arch: [x64] # x86 unsupported by MicroMamba |
21 | 21 | os: [ubuntu-latest, windows-latest, macos-latest] |
22 | 22 | jlversion: ['1','1.9'] |
| 23 | + pythonexe: ['@CondaPkg'] |
| 24 | + include: |
| 25 | + - arch: x64 |
| 26 | + os: ubuntu-latest |
| 27 | + jlversion: '1' |
| 28 | + pythonexe: python |
| 29 | + |
23 | 30 | steps: |
24 | | - - uses: actions/checkout@v4 |
| 31 | + - uses: actions/checkout@v5 |
| 32 | + |
25 | 33 | - name: Set up Julia ${{ matrix.jlversion }} |
26 | 34 | uses: julia-actions/setup-julia@v2 |
27 | 35 | with: |
28 | 36 | version: ${{ matrix.jlversion }} |
29 | 37 | arch: ${{ matrix.arch }} |
| 38 | + |
30 | 39 | - uses: julia-actions/cache@v2 |
| 40 | + |
31 | 41 | - name: Build package |
32 | 42 | uses: julia-actions/julia-buildpkg@v1 |
| 43 | + env: |
| 44 | + PYTHON: python |
| 45 | + |
33 | 46 | - name: Run tests |
34 | 47 | uses: julia-actions/julia-runtest@v1 |
35 | 48 | env: |
36 | 49 | JULIA_DEBUG: PythonCall |
37 | 50 | JULIA_NUM_THREADS: '2' |
| 51 | + PYTHON: python |
| 52 | + JULIA_PYTHONCALL_EXE: ${{ matrix.pythonexe }} |
| 53 | + |
38 | 54 | - name: Process coverage |
39 | 55 | uses: julia-actions/julia-processcoverage@v1 |
| 56 | + |
40 | 57 | - name: Upload coverage to Codecov |
41 | 58 | uses: codecov/codecov-action@v5 |
42 | 59 | env: |
43 | 60 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
| 61 | + |
44 | 62 | python: |
45 | | - name: Test (${{ matrix.os }}, python ${{ matrix.pyversion }}) |
| 63 | + name: Test Python (${{ matrix.pyversion }}, ${{ matrix.os }}, ${{ matrix.juliaexe }}) |
46 | 64 | runs-on: ${{ matrix.os }} |
47 | 65 | strategy: |
48 | | - fail-fast: true |
| 66 | + fail-fast: false |
49 | 67 | matrix: |
50 | 68 | os: [ubuntu-latest, windows-latest, macos-latest] |
51 | | - pyversion: ["3.x", "3.8"] |
| 69 | + pyversion: ["3", "3.9"] |
| 70 | + juliaexe: ["@JuliaPkg"] |
| 71 | + include: |
| 72 | + - os: ubuntu-latest |
| 73 | + pyversion: 3 |
| 74 | + juliaexe: julia |
| 75 | + env: |
| 76 | + MANUAL_TEST_PROJECT: /tmp/juliacall-test-project |
| 77 | + PYTHON_JULIACALL_THREADS: '2' |
| 78 | + PYTHON_JULIACALL_HANDLE_SIGNALS: 'yes' |
| 79 | + |
52 | 80 | steps: |
53 | | - - uses: actions/checkout@v4 |
| 81 | + - uses: actions/checkout@v5 |
| 82 | + |
54 | 83 | - name: Set up Python ${{ matrix.pyversion }} |
55 | | - uses: actions/setup-python@v5 |
| 84 | + uses: actions/setup-python@v6 |
56 | 85 | with: |
57 | 86 | python-version: ${{ matrix.pyversion }} |
| 87 | + |
| 88 | + - name: Set up uv |
| 89 | + uses: astral-sh/setup-uv@v6 |
| 90 | + with: |
| 91 | + python-version: ${{ matrix.pyversion }} |
| 92 | + |
58 | 93 | - name: Set up Julia |
| 94 | + id: setup_julia |
59 | 95 | uses: julia-actions/setup-julia@v2 |
60 | 96 | with: |
61 | 97 | version: '1' |
| 98 | + |
| 99 | + - name: Set up test Julia project |
| 100 | + if: ${{ matrix.juliaexe == 'julia' }} |
| 101 | + run: | |
| 102 | + mkdir ${{ env.MANUAL_TEST_PROJECT }} |
| 103 | + julia --project=${{ env.MANUAL_TEST_PROJECT }} -e 'import Pkg; Pkg.develop(path="."); Pkg.instantiate()' |
| 104 | +
|
62 | 105 | - name: Install dependencies |
63 | 106 | run: | |
64 | | - python -m pip install --upgrade pip |
65 | | - pip install flake8 pytest pytest-cov nbval numpy |
66 | 107 | cp pysrc/juliacall/juliapkg-dev.json pysrc/juliacall/juliapkg.json |
67 | | - pip install -e . |
| 108 | + uv sync --dev |
| 109 | +
|
68 | 110 | - name: Lint with flake8 |
69 | 111 | run: | |
70 | 112 | # stop the build if there are Python syntax errors or undefined names |
71 | | - flake8 . --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics |
| 113 | + uv run flake8 ./pysrc ./pytest --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics |
72 | 114 | # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
73 | | - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
74 | | - - name: Run tests |
| 115 | + uv run flake8 ./pysrc ./pytest --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 116 | +
|
| 117 | + - name: Run tests (with JuliaPkg) |
| 118 | + if: ${{ matrix.juliaexe == '@JuliaPkg' }} |
75 | 119 | run: | |
76 | | - pytest -s --nbval --cov=pysrc ./pytest/ |
| 120 | + uv run pytest -s --nbval --cov=pysrc ./pytest/ |
| 121 | +
|
| 122 | + - name: Run tests (without JuliaPkg) |
| 123 | + if: ${{ matrix.juliaexe == 'julia' }} |
| 124 | + run: | |
| 125 | + uv run pytest -s --nbval --cov=pysrc ./pytest/ |
77 | 126 | env: |
78 | | - PYTHON_JULIACALL_THREADS: '2' |
| 127 | + PYTHON_JULIACALL_EXE: "${{ steps.setup_julia.outputs.julia-bindir }}/julia" |
| 128 | + PYTHON_JULIACALL_PROJECT: ${{ env.MANUAL_TEST_PROJECT }} |
| 129 | + |
79 | 130 | - name: Upload coverage to Codecov |
80 | 131 | uses: codecov/codecov-action@v5 |
81 | 132 | env: |
|
0 commit comments