16
16
- name : Checkout working copy
17
17
uses : actions/checkout@v3
18
18
- name : Set up Python
19
- uses : actions/setup-python@v3
19
+ uses : actions/setup-python@v4
20
20
with :
21
- python-version : " 3.10 "
21
+ python-version : " 3.11 "
22
22
- name : Install checkers
23
23
run : |
24
24
python -mpip install --upgrade pip
@@ -28,43 +28,51 @@ jobs:
28
28
- name : black
29
29
run : black --check --diff --color --quiet .
30
30
31
+ # REPLACE BY: job which python -mbuild, and uploads the sdist and wheel to artifacts
32
+ # build is not binary so can just build the one using whatever python version
31
33
compile :
32
- strategy :
33
- fail-fast : false
34
- matrix :
35
- python-version :
36
- - " 3.8"
37
- - " 3.9"
38
- - " 3.10"
39
- - " 3.11"
40
- - " 3.12.0-alpha - 3.12"
41
- - " pypy-3.8"
42
- - " pypy-3.9"
43
- pyyaml-version : ["5.1.*", "5.4.*", "6.0.*", "6.*"]
44
34
runs-on : ubuntu-latest
45
35
46
36
steps :
47
37
- name : Checkout working copy
48
38
uses : actions/checkout@v3
49
- - name : Set up Python ${{ matrix.python-version }}
50
- uses : actions/setup-python@v3
51
39
with :
52
- python-version : ${{ matrix.python-version }}
40
+ submodules : true
41
+ - name : Set up Python
42
+ uses : actions/setup-python@v4
43
+ with :
44
+ python-version : " 3.11"
53
45
- name : Install dependency
54
46
run : |
55
47
python -mpip install --upgrade pip
56
- python -mpip install pyyaml==${{ matrix.pyyaml-version }}
57
- - name : Build regexes.py
58
- run : python setup.py build_regexes -i
59
- - name : Check results
48
+ python -mpip install build
49
+ - name : Build sdist and wheel
60
50
run : |
61
- # check that _regexes exists, and .eggs does not (== setuptools used our dependency)
62
- test -e src/ua_parser/_regexes.py -a ! -e .eggs
51
+ python -mbuild
52
+ - name : Upload sdist
53
+ uses : actions/upload-artifact@v3
54
+ with :
55
+ name : sdist
56
+ path : dist/*.tar.gz
57
+ retention-days : 1
58
+
59
+ - name : Upload wheel
60
+ uses : actions/upload-artifact@v3
61
+ with :
62
+ name : wheel
63
+ path : dist/*.whl
64
+ retention-days : 1
63
65
64
66
test :
67
+ runs-on : ubuntu-latest
68
+ needs : compile
65
69
strategy :
66
70
fail-fast : false
67
71
matrix :
72
+ source :
73
+ - wheel
74
+ - sdist
75
+ - source
68
76
python-version :
69
77
- " 3.8"
70
78
- " 3.9"
@@ -73,14 +81,18 @@ jobs:
73
81
- " 3.12.0-alpha - 3.12"
74
82
- " pypy-3.8"
75
83
- " pypy-3.9"
76
- runs-on : ubuntu-latest
84
+ include :
85
+ - source : sdist
86
+ artifact : dist/*.tar.gz
87
+ - source : wheel
88
+ artifact : dist/*.whl
77
89
steps :
78
90
- name : Checkout working copy
79
91
uses : actions/checkout@v3
80
92
with :
81
93
submodules : true
82
94
- name : Set up Python ${{ matrix.python-version }}
83
- uses : actions/setup-python@v3
95
+ uses : actions/setup-python@v4
84
96
with :
85
97
python-version : ${{ matrix.python-version }}
86
98
- name : Install test dependencies
@@ -94,7 +106,14 @@ jobs:
94
106
fi
95
107
fi
96
108
python -mpip install -r requirements_dev.txt
109
+ - name : download ${{ matrix.source }} artifact
110
+ if : matrix.artifact
111
+ uses : actions/download-artifact@v3
112
+ with :
113
+ name : ${{ matrix.source }}
114
+ path : dist/
97
115
- name : install package in environment
98
- run : pip install .
116
+ run : |
117
+ pip install ${{ matrix.artifact || '.' }}
99
118
- name : run tests
100
119
run : pytest -v -Werror -Wignore::ImportWarning --doctest-glob="*.rst"
0 commit comments