-
Notifications
You must be signed in to change notification settings - Fork 4
242 lines (211 loc) · 6.6 KB
/
package.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
name: Package
on:
push:
branches: [ main ]
paths-ignore:
- '**/*.md'
- '**/*.rst'
- 'docs/**'
pull_request:
branches: [ main ]
paths-ignore:
- '**/*.md'
- '**/*.rst'
- 'docs/**'
jobs:
check-rust:
name: Rust Checks
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check format
run: cargo fmt --all -- --check
- name: Check clippy
run: cargo clippy --all-targets --all-features -- -D warnings
check-python:
name: Python Checks
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dev dependencies
run: pip install -e ".[dev]"
- name: Check format
run: ruff format . --check
- name: Check style
run: ruff check .
build-main:
name: Build Main Package
needs: [check-rust, check-python]
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Create dist directory
run: mkdir -p dist
- name: Build main package
run: |
python -m pip install --upgrade pip build
python -m build --outdir dist/
- name: List dist contents
run: ls -la dist/
- name: Upload main artifact
uses: actions/upload-artifact@v3
with:
name: dist-main
path: dist/*
if-no-files-found: error
build-services:
name: Build Service Packages
needs: [build-main]
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
target: [x86_64]
service: [memory, s3]
exclude:
- os: ubuntu-24.04
target: aarch64
include:
- os: ubuntu-24.04
target: x86_64
platform: manylinux2014
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Create dist directory
run: mkdir -p dist
- name: Build service package
id: build-service
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: ${{ matrix.platform }}
container: quay.io/pypa/manylinux2014_x86_64
args: --release --out dist
command: build
working-directory: crates/service-${{ matrix.service }}
- name: List dist contents
run: |
echo "=== Service build output ==="
ls -la dist/
- name: Upload service artifact
uses: actions/upload-artifact@v3
with:
name: dist-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.service }}
path: dist/*.whl
if-no-files-found: error
verify-install:
name: Verify Installation
needs: [build-services]
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: dist
- name: List downloaded artifacts
run: |
echo "=== All artifacts ==="
find dist -type f
echo "=== Service artifacts ==="
find dist/dist-ubuntu-24.04-x86_64-memory dist/dist-ubuntu-24.04-x86_64-s3 -type f
- name: Prepare dist directory
run: |
mkdir -p dist_combined
# Copy service wheels first
cp dist/dist-ubuntu-24.04-x86_64-memory/*.whl dist_combined/
cp dist/dist-ubuntu-24.04-x86_64-s3/*.whl dist_combined/
# Copy main package
cp dist/dist-main/*.whl dist_combined/
cp dist/dist-main/*.tar.gz dist_combined/
echo "=== Contents of dist_combined ==="
ls -la dist_combined/
- name: Install packages in correct order
run: |
python -m pip install --upgrade pip
echo "=== Installing service packages ==="
# Install memory service
for whl in dist_combined/opendalfs_service_memory*.whl; do
if [ -f "$whl" ]; then
echo "Installing memory service: $whl"
pip install "$whl"
fi
done
# Install s3 service
for whl in dist_combined/opendalfs_service_s3*.whl; do
if [ -f "$whl" ]; then
echo "Installing s3 service: $whl"
pip install "$whl"
fi
done
echo "=== Installing main package ==="
pip install dist_combined/opendalfs-*.whl
- name: Verify imports
run: |
echo "=== Installed packages ==="
pip list | grep opendalfs
echo "=== Verifying imports ==="
python -c "import opendalfs"
python -c "import opendalfs_service_memory"
python -c "import opendalfs_service_s3"
- name: Test full installation
run: |
# Clean previous installation
pip uninstall -y opendalfs opendalfs_service_memory opendalfs_service_s3
# Install with all extras
pip install dist_combined/opendalfs*.whl[all]
# Verify again
python -c "import opendalfs"
python -c "import opendalfs_service_memory"
python -c "import opendalfs_service_s3"
# PyPI publishing job (commented out for future use)
# publish:
# name: Publish to PyPI
# needs: verify-install
# runs-on: ubuntu-24.04
# # Only run on tags
# if: startsWith(github.ref, 'refs/tags/')
#
# steps:
# - name: Download all artifacts
# uses: actions/download-artifact@v3
# with:
# path: dist
#
# - name: Prepare dist directory
# run: |
# mkdir -p dist_combined
# cp -r dist/*/* dist_combined/
#
# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
# packages-dir: dist_combined/
#
# Required secrets for PyPI publishing:
# - PYPI_API_TOKEN: API token from PyPI
# Get it from: https://pypi.org/manage/account/token/
# Add it to: https://github.com/fsspec/opendalfs/settings/secrets/actions