-
Notifications
You must be signed in to change notification settings - Fork 98
94 lines (77 loc) · 2.19 KB
/
packaging.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#
# Test job to see how packaging looks like.
#
name: Build distributions
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: |
python -m pip install -U pip
pip install build
- run: python -m build --wheel -vv
- if: matrix.os == 'ubuntu-latest'
run: python -m build --sdist -vv
# We only need a single source distribution
- uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}
retention-days: 1
path: dist
make_artifact:
name: Combine artifacts
needs: build_wheels
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
# Download all artifacts so far
- uses: actions/upload-artifact@v4
with:
name: package-all
path: dist
test_artifacts:
name: Test distributions
needs: make_artifact
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/download-artifact@v4
with:
name: package-all
path: dist
- uses: actions/setup-python@v5
with:
python-version: "3.12"
# Now install the package from the local wheels and try to use it:
- run: |
pip install pyads --no-index --find-links ./dist
python -c "import pyads; pyads.Connection(ams_net_id='127.0.0.1.1.1', ams_net_port=851)"
test_editable:
name: Test editable install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: |
pip install -e . -vv
python -c "import pyads; pyads.Connection(ams_net_id='127.0.0.1.1.1', ams_net_port=851)"