Repository navigation
61 lines (55 loc) · 1.71 KB
/
Copy pathtest-python.yml
File metadata and controls
61 lines (55 loc) · 1.71 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
name: Python tests
# The `rustgis` Python package built and tested on each runner in `os` (a JSON list): Linux on
# every supported Python, other platforms on the newest. For the Python package workflow and
# CI on label.
on:
workflow_call:
inputs:
os:
description: Runners to test on, as a JSON list
required: true
type: string
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
plan:
name: Pythons
runs-on: ubuntu-latest
outputs:
include: ${{ steps.include.outputs.include }}
steps:
- id: include
env:
OS: ${{ inputs.os }}
run: |
echo "include=$(jq -c 'map(if . == "ubuntu-latest" then ("3.12", "3.13", "3.14") as $p | {os: ., python: $p} else {os: ., python: "3.14"} end)' <<<"$OS")" >> "$GITHUB_OUTPUT"
test:
name: Test (${{ matrix.os }}, Python ${{ matrix.python }})
needs: plan
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.plan.outputs.include) }}
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
# Only main saves the cache (see test-rust.yml).
save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
- name: Build and install
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install "./apps/rustgis-python[test,geopandas]"
- name: Test
working-directory: apps/rustgis-python
run: python -m pytest -q