-
Notifications
You must be signed in to change notification settings - Fork 78
175 lines (153 loc) · 5.14 KB
/
tests.yml
File metadata and controls
175 lines (153 loc) · 5.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Tests
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- '*'
jobs:
julia:
name: Test Julia (${{ matrix.jlversion }}, ${{ matrix.os }}, ${{ matrix.pythonstr }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
arch: [x64] # x86 unsupported by MicroMamba
os: [ubuntu-latest, windows-latest, macos-latest]
jlversion: ['1','1.10']
pythonexe: ['@CondaPkg']
pythonver: ['@CondaPkg']
pythonstr: ['@CondaPkg']
include:
- arch: x64
os: ubuntu-latest
jlversion: '1'
pythonexe: python
pythonver: '3.14'
pythonstr: python 3.14
- arch: x64
os: ubuntu-latest
jlversion: '1'
pythonexe: python
pythonver: '3.13'
pythonstr: python 3.13
- arch: x64
os: ubuntu-latest
jlversion: '1'
pythonexe: python
pythonver: '3.12'
pythonstr: python 3.12
- arch: x64
os: ubuntu-latest
jlversion: '1'
pythonexe: python
pythonver: '3.11'
pythonstr: python 3.11
- arch: x64
os: ubuntu-latest
jlversion: '1'
pythonexe: python
pythonver: '3.10'
pythonstr: python 3.10
steps:
- uses: actions/checkout@v5
- name: Set up Julia ${{ matrix.jlversion }}
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.jlversion }}
arch: ${{ matrix.arch }}
- name: Set up Python ${{ matrix.pythonver }}
if: ${{ matrix.pythonexe == 'python' }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.pythonver }}
- uses: julia-actions/cache@v2
- name: Build package
uses: julia-actions/julia-buildpkg@v1
env:
PYTHON: python
- name: Run tests
uses: julia-actions/julia-runtest@v1
env:
JULIA_DEBUG: PythonCall
JULIA_NUM_THREADS: '2'
PYTHON: python
JULIA_PYTHONCALL_EXE: ${{ matrix.pythonexe }}
- name: Process coverage
uses: julia-actions/julia-processcoverage@v1
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
python:
name: Test Python (${{ matrix.pyversion }}, ${{ matrix.os }}, ${{ matrix.juliaexe }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
pyversion: ["3", "3.10"]
juliaexe: ["@JuliaPkg"]
include:
- os: ubuntu-latest
pyversion: 3
juliaexe: julia
env:
MANUAL_TEST_PROJECT: /tmp/juliacall-test-project
PYTHON_JULIACALL_THREADS: '2'
PYTHON_JULIACALL_HANDLE_SIGNALS: 'yes'
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.pyversion }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.pyversion }}
- name: Check Python OpenSSL version (see setup_julia)
shell: python
run: |
import ssl
assert ssl.OPENSSL_VERSION_INFO < (3, 5)
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.pyversion }}
- name: Set up Julia
id: setup_julia
uses: julia-actions/setup-julia@v2
with:
# Python in the GitHub runners ships with OpenSSL 3.0. Julia 1.12 requires
# OpenSSL 3.5. Therefore juliapkg requires Julia 1.11 or lower.
version: '1.11'
- name: Set up test Julia project
if: ${{ matrix.juliaexe == 'julia' }}
run: |
mkdir ${{ env.MANUAL_TEST_PROJECT }}
julia --project=${{ env.MANUAL_TEST_PROJECT }} -e 'import Pkg; Pkg.develop(path="."); Pkg.instantiate()'
- name: Install dependencies
run: |
cp pysrc/juliacall/juliapkg-dev.json pysrc/juliacall/juliapkg.json
uv sync --dev
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
uv run flake8 ./pysrc ./pytest --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
uv run flake8 ./pysrc ./pytest --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run tests (with JuliaPkg)
if: ${{ matrix.juliaexe == '@JuliaPkg' }}
run: |
uv run pytest -s --nbval --cov=pysrc ./pytest/
- name: Run tests (without JuliaPkg)
if: ${{ matrix.juliaexe == 'julia' }}
run: |
uv run pytest -s --nbval --cov=pysrc ./pytest/
env:
PYTHON_JULIACALL_EXE: "${{ steps.setup_julia.outputs.julia-bindir }}/julia"
PYTHON_JULIACALL_PROJECT: ${{ env.MANUAL_TEST_PROJECT }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}