@@ -6,20 +6,19 @@ name: Python application
6
6
on :
7
7
push :
8
8
pull_request :
9
- branches : [ "main" ]
9
+ branches : ["main"]
10
10
schedule :
11
- - cron : ' 0 2 * * 3'
11
+ - cron : " 0 2 * * 3"
12
12
13
13
permissions :
14
14
contents : read
15
15
16
-
17
16
jobs :
18
17
format :
19
18
runs-on : ubuntu-latest
20
19
steps :
21
20
- uses : actions/checkout@v4
22
- - uses : psf/black@stable
21
+ - uses : psf/black@stable
23
22
lint :
24
23
name : Lint with ruff
25
24
runs-on : ubuntu-latest
30
29
with :
31
30
python-version : " 3.11"
32
31
- name : Install ruff
33
- run : |
32
+ run : |
34
33
pip install ruff
35
- - name : Lint with ruff
34
+ - name : Lint with ruff
36
35
run : |
37
36
# stop the build if there are Python syntax errors or undefined names
38
37
ruff check .
@@ -48,36 +47,36 @@ jobs:
48
47
uses : actions/setup-python@v5
49
48
with :
50
49
python-version : ${{ matrix.python-version }}
51
- cache : ' pip' # caching pip dependencies
52
- cache-dependency-path : ' **/pyproject.toml'
50
+ cache : " pip" # caching pip dependencies
51
+ cache-dependency-path : " **/pyproject.toml"
53
52
- name : Install dependencies
54
53
run : |
55
54
python -m pip install --upgrade pip
56
55
pip install pytest
57
56
pip install -e .
58
57
- name : Run tests
59
58
run : python -m pytest tests
60
-
59
+
61
60
build_source_dist :
62
61
name : Build source distribution
63
62
if : startsWith(github.ref, 'refs/heads/main') || startsWith(github.ref, 'refs/tags')
64
63
runs-on : ubuntu-latest
65
64
steps :
66
- - uses : actions/checkout@v4
65
+ - uses : actions/checkout@v4
67
66
68
- - uses : actions/setup-python@v5
69
- with :
70
- python-version : " 3.10"
67
+ - uses : actions/setup-python@v5
68
+ with :
69
+ python-version : " 3.10"
71
70
72
- - name : Install build
73
- run : python -m pip install build
71
+ - name : Install build
72
+ run : python -m pip install build
74
73
75
- - name : Run build
76
- run : python -m build --sdist
74
+ - name : Run build
75
+ run : python -m build --sdist
77
76
78
- - uses : actions/upload-artifact@v4
79
- with :
80
- path : ./dist/*.tar.gz
77
+ - uses : actions/upload-artifact@v4
78
+ with :
79
+ path : ./dist/*.tar.gz
81
80
# Needed in case of building packages with external binaries (e.g. Cython, RUst-extensions, etc.)
82
81
# build_wheels:
83
82
# name: Build wheels on ${{ matrix.os }}
@@ -105,25 +104,25 @@ jobs:
105
104
# path: ./wheels/*.whl
106
105
107
106
publish :
108
- name : Publish package
109
- if : startsWith(github.ref, 'refs/tags')
110
- needs :
111
- - format
112
- - lint
113
- - test
114
- - build_source_dist
115
- # - build_wheels
116
- runs-on : ubuntu-latest
117
-
118
- steps :
119
- - uses : actions/download-artifact@v4
120
- with :
121
- name : artifact
122
- path : ./dist
123
-
124
- - uses : pypa/gh-action-pypi-publish@release/v1
125
- with :
126
- # remove repository key to set the default to pypi (not test.pypi.org)
127
- repository-url : https://test.pypi.org/legacy/
128
- user : __token__
129
- password : ${{ secrets.PYPI_API_TOKEN }}
107
+ name : Publish package
108
+ if : startsWith(github.ref, 'refs/tags')
109
+ needs :
110
+ - format
111
+ - lint
112
+ - test
113
+ - build_source_dist
114
+ # - build_wheels
115
+ runs-on : ubuntu-latest
116
+
117
+ steps :
118
+ - uses : actions/download-artifact@v4
119
+ with :
120
+ name : artifact
121
+ path : ./dist
122
+
123
+ - uses : pypa/gh-action-pypi-publish@release/v1
124
+ with :
125
+ # remove repository key to set the default to pypi (not test.pypi.org)
126
+ repository-url : https://test.pypi.org/legacy/
127
+ user : __token__
128
+ password : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments