-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (69 loc) · 1.96 KB
/
build-test-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: "build-test-publish"
on: [push, pull_request]
jobs:
build_wheel:
name: Build Python wheels
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: "Build pure Python wheels"
run: |
python -m pip install hatch
cd src
hatch build
- uses: actions/upload-artifact@v4
with:
name: wheel
path: ./src/dist/itk_dreg-*.whl
pytest:
name: "Test with PyTest"
runs-on: ubuntu-latest
needs:
- build_wheel
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Update pip
run: |
python -m pip install --upgrade pip
- name: "Install Dependencies"
shell: bash
working-directory: src
run: |
python -m pip install -e '.[test]'
- name: "Install itk-dreg from source"
working-directory: src
run: |
wheel_name_full=`(find . -name "itk_dreg-*.whl")`
python -m pip install -e '.[test]'
- name: "Run Tests"
shell: bash
working-directory: src
run: |
pytest -vvv -s -k "not localcluster and not serialize_pairwise_result"
publish:
needs:
- build_wheel
- pytest
runs-on: ubuntu-22.04
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
environment:
name: pypi
url: https://pypi.org/p/itk-dreg
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download Python Wheel Artifact
uses: actions/download-artifact@v4
with:
name: wheel
path: dist
- name: "Publish Python wheel to the Python Package Index"
uses: pypa/[email protected]
with:
skip_existing: true