@@ -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,24 @@ 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
+ - run : pip install --disable-pip-version-check -r requirements.txt
38
+ - uses : actions/download-artifact@v4
39
+ - run : pip install $(dist/*.whl)
40
+ - run : pytest
22
41
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 :
42
+ deploy-pypi :
36
43
if : startsWith(github.ref, 'refs/tags')
37
- needs : CI
44
+ needs : build
38
45
runs-on : ubuntu-latest
39
46
40
47
steps :
41
48
- uses : actions/checkout@v4
42
49
- uses : actions/setup-python@v5
50
+ with :
51
+ python-version : 3.12
43
52
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
-
53
+ - run : pip install --disable-pip-version-check -r requirements.txt
54
+ - uses : actions/download-artifact@v4
52
55
- name : Publish
53
56
env :
54
57
TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments