-
Notifications
You must be signed in to change notification settings - Fork 449
112 lines (100 loc) · 3.4 KB
/
Copy pathtests-pypi.yml
File metadata and controls
112 lines (100 loc) · 3.4 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
name: PyPI Tests
# We don't want pushes (or PRs) to gh-pages to kick anything off
on:
push:
branches:
- main
- '[0-9]+.[0-9]+.x'
pull_request:
branches:
- main
- '[0-9]+.[0-9]+.x'
concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
#
# Run all tests on Linux using standard PyPI packages, including minimum requirements
#
PyPITests:
name: ${{ matrix.python-version }} ${{ matrix.dep-versions }} ${{ matrix.no-extras }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
python-version: [3.11, 3.12, 3.13, 3.14]
dep-versions: [Latest]
no-extras: ['']
include:
- python-version: 3.11
dep-versions: Minimum
- python-version: 3.11
dep-versions: Minimum
no-extras: 'No Extras'
- python-version: 3.14
dep-versions: Latest
no-extras: 'No Extras'
steps:
- name: Checkout source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 150
fetch-tags: true
persist-credentials: false
- name: Generate minimum dependencies
if: ${{ matrix.dep-versions == 'Minimum' }}
run: |
pip install tomli
python << EOF
import tomli as tomllib
from pathlib import Path
# Read our pyproject.toml
config = tomllib.load(open('pyproject.toml', 'rb'))['project']
opt_deps = config['optional-dependencies']
# Generate a Minimum dependency file
for src, fname in [(config['dependencies'], 'ci/requirements.txt'),
(opt_deps['test'], 'ci-dev/test_requirements.txt'),
(opt_deps['extras'], 'ci/extra_requirements.txt')]:
with Path(fname).open('wt') as out:
for dep in src:
dep = dep.split(';')[0]
out.write(dep.replace('>=', '==') + '\n')
EOF
- name: Install from PyPI
uses: ./.github/actions/install-pypi
with:
need-extras: ${{ matrix.no-extras != 'No Extras' }}
type: 'test'
python-version: ${{ matrix.python-version }}
old-build: ${{ matrix.no-extras != 'No Extras' && matrix.dep-versions == 'Minimum' }}
need-cartopy: ${{ matrix.no-extras != 'No Extras' }}
- name: Run tests
uses: ./.github/actions/run-tests
with:
run-doctests: ${{ matrix.dep-versions == 'Latest' && matrix.no-extras != 'No Extras' }}
key: pypi-${{ matrix.python-version }}-${{ matrix.dep-versions }}-${{ matrix.no-extras }}-${{ runner.os }}
codecov:
needs: PyPITests
name: CodeCov Upload
runs-on: ubuntu-slim
permissions:
contents: read
environment:
name: CodeCov
deployment: false
timeout-minutes: 2
steps:
- name: Checkout source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download coverage artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
- name: Upload coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: PyPI
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}