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