-
Notifications
You must be signed in to change notification settings - Fork 0
176 lines (142 loc) · 4 KB
/
ci.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
edit_sys_path:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.x']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install --upgrade scipy
- name: Run code with sys path edited
run: |
cd examples/edit_sys_path
python example.py
simple:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.x']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Local install
run: |
python -m pip install --upgrade pip wheel
cd examples/simple_packaging
python -m pip install .
- name: List installed Python packages
run: python -m pip list
- name: Cleanup to have dist build be as clean as possible
run: |
cd examples/simple_packaging
rm -rf src/rosen/_version.py
rm -rf build
- name: Build a sdist and wheel
run: |
cd examples/simple_packaging
pipx run build .
- name: Verify the distribution
run: |
cd examples/simple_packaging
pipx run twine check --strict dist/*
- name: List contents of sdist
run: |
cd examples/simple_packaging
python -m tarfile --list dist/rosen-*.tar.gz
- name: List contents of wheel
run: |
cd examples/simple_packaging
python -m zipfile --list dist/rosen-*.whl
- name: Run tests with pytest
run: |
python -m pip install --upgrade pytest
cd examples/simple_packaging
pytest tests/
- name: Upload simple packaging dists
uses: actions/upload-artifact@v4
with:
name: simple_packaging
path: examples/simple_packaging/dist/
compiled:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.x']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Local install
run: |
python -m pip install --upgrade pip wheel
cd examples/compiled_packaging
python -m pip install .
- name: List installed Python packages
run: python -m pip list
- name: Cleanup to have dist build be as clean as possible
run: |
cd examples/compiled_packaging
rm -rf src/rosen_cpp/_version.py
rm -rf build
- name: Build a sdist and wheel
run: |
cd examples/compiled_packaging
pipx run build .
- name: Verify the distribution
run: |
cd examples/compiled_packaging
pipx run twine check --strict dist/*
- name: List contents of sdist
run: |
cd examples/compiled_packaging
python -m tarfile --list dist/rosen_cpp-*.tar.gz
- name: List contents of wheel
run: |
cd examples/compiled_packaging
python -m zipfile --list dist/rosen_cpp-*.whl
- name: Run tests with pytest
run: |
python -m pip install --upgrade pytest
cd examples/compiled_packaging
pytest tests/
- name: Upload compiled packaging dists
uses: actions/upload-artifact@v4
with:
name: compiled_packaging
path: examples/compiled_packaging/dist/