@@ -3,11 +3,29 @@ name: CI/CD
3
3
on : push
4
4
5
5
jobs :
6
- CI :
6
+ build-wheel :
7
+ runs-on : ubuntu-latest
8
+
9
+ steps :
10
+ - uses : actions/checkout@v4
11
+ - uses : actions/setup-python@v5
12
+ with :
13
+ python-version : 3.12
14
+
15
+ - run : pip install --disable-pip-version-check -r requirements.txt
16
+ - run : pycodestyle tnz/*.py
17
+ - run : python -m build --wheel --outdir dist/
18
+ - uses : actions/upload-artifact@v4
19
+ with :
20
+ name : dist
21
+ path : dist/
22
+
23
+ test-wheel :
24
+ needs : build-wheel
7
25
runs-on : ubuntu-latest
8
26
strategy :
9
27
matrix :
10
- python-version : [ '3.7', '3.8', '3.9', '3.10' ]
28
+ python-version : [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ]
11
29
12
30
steps :
13
31
- uses : actions/checkout@v4
@@ -16,39 +34,23 @@ jobs:
16
34
with :
17
35
python-version : ${{ matrix.python-version }}
18
36
19
- - name : Install dependencies
20
- run : |
21
- pip install --disable-pip-version-check -r requirements.txt
37
+ - uses : actions/download-artifact@v4
38
+ - run : pip install $(ls dist/*.whl)
39
+ - run : pytest
22
40
23
- - name : Lint
24
- run : |
25
- pycodestyle tnz/*.py
26
-
27
- - name : Install tnz
28
- run : |
29
- pip install .
30
-
31
- - name : Run tests
32
- run : |
33
- pytest
34
-
35
- CD :
41
+ deploy-pypi :
36
42
if : startsWith(github.ref, 'refs/tags')
37
- needs : CI
43
+ needs : build-wheel
38
44
runs-on : ubuntu-latest
39
45
40
46
steps :
41
47
- uses : actions/checkout@v4
42
48
- uses : actions/setup-python@v5
49
+ with :
50
+ python-version : 3.12
43
51
44
- - name : Install dependencies
45
- run : |
46
- pip install --disable-pip-version-check -r requirements.txt
47
-
48
- - name : Build dist
49
- run : |
50
- python -m build --wheel --outdir dist/
51
-
52
+ - run : pip install --disable-pip-version-check -r requirements.txt
53
+ - uses : actions/download-artifact@v4
52
54
- name : Publish
53
55
env :
54
56
TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments