Skip to content

Commit f24fc7c

Browse files
committed
update main workflow
1 parent 4271c91 commit f24fc7c

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

.github/workflows/build_main.yml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,50 @@ on:
55
branches:
66
- 'main'
77

8+
permissions:
9+
id-token: write
10+
contents: read
11+
812
jobs:
9-
build:
13+
publish-to-pypi:
1014
runs-on: ubuntu-latest
15+
environment: release
16+
permissions:
17+
id-token: write
18+
strategy:
19+
matrix:
20+
python-version: ["3.9", "3.10", "3.11", "3.12"]
21+
1122
steps:
12-
- uses: actions/checkout@v3
23+
- name: Checkout code
24+
uses: actions/checkout@v4
1325

1426
- name: Set up Python
15-
uses: actions/setup-python@v4
27+
uses: actions/setup-python@v5
1628
with:
17-
python-version: '3.9'
29+
python-version: ${{ matrix.python-version }}
1830

19-
- name: Install environment dependencies
31+
- name: Install dependencies
2032
run: |
2133
python -m pip install --upgrade pip
2234
python -m pip install flake8
2335
python -m pip install build
36+
python -m pip install .
2437
25-
- name: Install project dependencies
26-
run: python -m pip install .
27-
28-
- name: Lint with flake8
38+
- name: Stop on syntax problems
2939
run: |
30-
# stop the build if there are Python syntax errors or undefined names
3140
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
32-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3341
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3442
35-
- name: Test with unittest
36-
run: python -m unittest discover ./SpatialTransform/tests
43+
- name: Run tests
44+
run: python -m unittest discover -s SpatialTransform -p "test_*.py" -v
3745

3846
- name: Build package
39-
run: python -m build
47+
run: |
48+
python -m build
4049
41-
- name: Publish package PyPI
50+
- name: Publish to TestPyPI
4251
uses: pypa/gh-action-pypi-publish@release/v1
4352
with:
44-
password: ${{ secrets.PYPI_API_TOKEN }}
53+
repository-url: https://test.pypi.org/legacy/
54+
verbose: true

0 commit comments

Comments
 (0)