forked from Unidata/MetPy
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (69 loc) · 2.41 KB
/
tests-pypi.yml
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
name: PyPI Tests
# We don't want pushes (or PRs) to gh-pages to kick anything off
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
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-20.04
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, "3.10"]
dep-versions: [requirements.txt]
no-extras: ['']
include:
- python-version: 3.7
dep-versions: Minimum
no-extras: 'No Extras'
- python-version: 3.9
dep-versions: requirements.txt
no-extras: 'No Extras'
steps:
# We check out only a limited depth and then pull tags to save time
- name: Checkout source
uses: actions/checkout@v2
with:
fetch-depth: 100
- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Add extras to requirements
if: ${{ matrix.no-extras != 'No Extras' }}
run: cat ci/extra_requirements.txt >> ci/test_requirements.txt
- name: Generate minimum dependencies
if: ${{ matrix.dep-versions == 'Minimum' }}
run: |
python << EOF
import configparser
from pathlib import Path
# Read our setup.cfg
config = configparser.ConfigParser()
config.read('setup.cfg')
# Generate a Minimum dependency file
with (Path('ci') / 'Minimum').open('wt') as out:
for dep in config['options']['install_requires'].split('\n'):
if dep:
dep = dep.split(';')[0]
out.write(dep.replace('>=', '==') + '\n')
EOF
- name: Install from PyPI
uses: ./.github/actions/install-pypi
with:
need-cartopy: ${{ matrix.no-extras != 'No Extras' }}
type: 'test'
version-file: ${{ matrix.dep-versions }}
python-version: ${{ matrix.python-version }}
- name: Run tests
uses: ./.github/actions/run-tests
with:
run-doctests: ${{ matrix.dep-versions == 'requirements.txt' && matrix.no-extras != 'No Extras' }}
key: pypi-${{ matrix.python-version }}-${{ matrix.dep-versions }}-${{ matrix.no-extras }}-${{ runner.os }}