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