Repository navigation
88 lines (76 loc) · 2.78 KB
/
Copy pathpython.yml
File metadata and controls
88 lines (76 loc) · 2.78 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
name: Python CI
# Path-filtered so the Python package builds standalone: this workflow only
# runs when files under python/ (or this workflow itself) change.
on:
push:
branches: [main]
paths:
- "python/**"
- "scripts/python_dev.py"
- ".github/workflows/python.yml"
pull_request:
paths:
- "python/**"
- "scripts/python_dev.py"
- ".github/workflows/python.yml"
permissions:
contents: read
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Lint and format check
run: python scripts/python_dev.py lint
# Load Python versions generated from [tool.python-support].
versions:
name: python versions
runs-on: ubuntu-latest
outputs:
data: ${{ steps.set.outputs.data }}
steps:
- name: Check out the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Generate supported versions from pyproject.toml
id: set
run: echo "data=$(python scripts/python_dev.py list-supported-versions)" >> "$GITHUB_OUTPUT"
test:
name: py${{ matrix.python-version }} on ${{ matrix.os }}
needs: versions
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Every supported version runs on Linux;
# the other platforms test the ends of the range, which is where
# interpreter differences show up.
os: [ubuntu-latest]
python-version: ${{ fromJson(needs.versions.outputs.data).all }}
include:
- os: windows-latest
python-version: "${{ fromJson(needs.versions.outputs.data).min }}"
- os: windows-latest
python-version: "${{ fromJson(needs.versions.outputs.data).max }}"
- os: macos-14
python-version: "${{ fromJson(needs.versions.outputs.data).min }}"
- os: macos-14
python-version: "${{ fromJson(needs.versions.outputs.data).max }}"
steps:
- name: Check out the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install and run tests
run: python scripts/python_dev.py test