-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (114 loc) · 3.67 KB
/
Copy pathtest.yml
File metadata and controls
120 lines (114 loc) · 3.67 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
name: Test
# On-demand / ad-hoc test workflow, kept separate from release.yaml's own
# release-gate test job so it can be run without cutting a release. Two ways
# to trigger it:
# - workflow_dispatch (optionally against a specific ref), for manual runs.
# - push of a tag matching "ci-*" (throwaway tag, delete after) so an agent
# without dashboard access can trigger + poll a run via the API/CLI.
# Not triggered by push/PR on branches by default -- add that only if the
# project actually wants CI on every commit.
on:
workflow_dispatch:
inputs:
ref:
description: "Git ref to test (branch, tag, or SHA)"
required: false
default: ""
benchmark_recursive:
description: "Run the recursive SFTP benchmark cases"
required: false
default: "false"
push:
tags:
- "ci-*"
permissions:
contents: read
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test (py${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Ubuntu full matrix
- os: ubuntu-latest
python-version: "3.9"
- os: ubuntu-latest
python-version: "3.10"
- os: ubuntu-latest
python-version: "3.11"
- os: ubuntu-latest
python-version: "3.12"
- os: ubuntu-latest
python-version: "3.13"
# Windows/macOS matrix edges
- os: windows-latest
python-version: "3.9"
- os: windows-latest
python-version: "3.13"
- os: macos-latest
python-version: "3.9"
- os: macos-latest
python-version: "3.13"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install package with all extras
run: python -m pip install -e ".[dev,uri,http,sftp,sftp-async]"
- name: Run tests
run: python -m pytest -q
test-no-extras:
name: Test No-Extras (py3.9, ubuntu)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install package without extras
run: |
python -m pip install --upgrade pip
pip install -e . uritools pytest
- name: Run smoke and local tests without extras
run: |
python -m pytest -q tests/test_smoke.py tests/test_local.py tests/test_mempath.py tests/test_data_uri.py
benchmark:
name: Benchmarks (py3.12, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install benchmark dependencies
run: python -m pip install -e ".[dev,uri,http,sftp,sftp-async]"
- name: Run benchmark suite
env:
PATHLIB_NEXT_BENCH_SFTP_RECURSIVE: ${{ inputs.benchmark_recursive == 'true' && '1' || '0' }}
shell: pwsh
run: |
python benchmarks/bench.py | Tee-Object -FilePath benchmark.txt
- name: Upload benchmark artifact
uses: actions/upload-artifact@v4
with:
name: benchmark-${{ matrix.os }}
path: benchmark.txt