|
5 | 5 | branches: |
6 | 6 | - 'main' |
7 | 7 |
|
| 8 | +permissions: |
| 9 | + id-token: write |
| 10 | + contents: read |
| 11 | + |
8 | 12 | jobs: |
9 | | - build: |
| 13 | + publish-to-pypi: |
10 | 14 | 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 | + |
11 | 22 | steps: |
12 | | - - uses: actions/checkout@v3 |
| 23 | + - name: Checkout code |
| 24 | + uses: actions/checkout@v4 |
13 | 25 |
|
14 | 26 | - name: Set up Python |
15 | | - uses: actions/setup-python@v4 |
| 27 | + uses: actions/setup-python@v5 |
16 | 28 | with: |
17 | | - python-version: '3.9' |
| 29 | + python-version: ${{ matrix.python-version }} |
18 | 30 |
|
19 | | - - name: Install environment dependencies |
| 31 | + - name: Install dependencies |
20 | 32 | run: | |
21 | 33 | python -m pip install --upgrade pip |
22 | 34 | python -m pip install flake8 |
23 | 35 | python -m pip install build |
| 36 | + python -m pip install . |
24 | 37 |
|
25 | | - - name: Install project dependencies |
26 | | - run: python -m pip install . |
27 | | - |
28 | | - - name: Lint with flake8 |
| 38 | + - name: Stop on syntax problems |
29 | 39 | run: | |
30 | | - # stop the build if there are Python syntax errors or undefined names |
31 | 40 | 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 |
33 | 41 | flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
34 | 42 |
|
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 |
37 | 45 |
|
38 | 46 | - name: Build package |
39 | | - run: python -m build |
| 47 | + run: | |
| 48 | + python -m build |
40 | 49 |
|
41 | | - - name: Publish package PyPI |
| 50 | + - name: Publish to TestPyPI |
42 | 51 | uses: pypa/gh-action-pypi-publish@release/v1 |
43 | 52 | with: |
44 | | - password: ${{ secrets.PYPI_API_TOKEN }} |
| 53 | + repository-url: https://test.pypi.org/legacy/ |
| 54 | + verbose: true |
0 commit comments