File tree Expand file tree Collapse file tree 3 files changed +104
-0
lines changed Expand file tree Collapse file tree 3 files changed +104
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Lint Python Code
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - master
7+ push :
8+
9+ jobs :
10+ format :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - uses : actions/checkout@v4
15+
16+ - uses : actions/setup-python@v5
17+ with :
18+ python-version : " 3.x"
19+
20+ - name : Install dependencies
21+ run : |
22+ python -m pip install --upgrade pip
23+ pip install black
24+ - name : Check code formatting with black
25+ black --check --diff $(git ls-files '*.py')
Original file line number Diff line number Diff line change 1+ name : Deploy
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ permissions :
8+ contents : read
9+
10+ jobs :
11+ release-build :
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - uses : actions/checkout@v4
16+
17+ - uses : actions/setup-python@v5
18+ with :
19+ python-version : " 3.x"
20+
21+ - name : Build release distributions
22+ run : |
23+ python -m pip install build
24+ python -m build
25+
26+ - name : Upload distributions
27+ uses : actions/upload-artifact@v4
28+ with :
29+ name : release-dists
30+ path : dist/
31+
32+ pypi-publish :
33+ runs-on : ubuntu-latest
34+ needs :
35+ - release-build
36+ permissions :
37+ id-token : write
38+
39+ environment :
40+ name : pypi
41+ url : https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
42+
43+ steps :
44+ - name : Retrieve release distributions
45+ uses : actions/download-artifact@v4
46+ with :
47+ name : release-dists
48+ path : dist/
49+
50+ - name : Publish release distributions to PyPI
51+ uses : pypa/gh-action-pypi-publish@release/v1
52+ with :
53+ packages-dir : dist/
Original file line number Diff line number Diff line change 1+ name : Run Tests
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - master
7+ push :
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - uses : actions/checkout@v4
15+
16+ - uses : actions/setup-python@v5
17+ with :
18+ python-version : " 3.x"
19+
20+ - name : Install dependencies
21+ run : |
22+ python -m pip install --upgrade pip
23+ pip install .[dev]
24+
25+ - name : Run pytest
26+ run : pytest
You can’t perform that action at this time.
0 commit comments