-
Notifications
You must be signed in to change notification settings - Fork 28
76 lines (64 loc) · 1.97 KB
/
build-packages.yml
File metadata and controls
76 lines (64 loc) · 1.97 KB
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
---
name: Build and Test Python Packages
on:
push:
branches:
- 'main'
- 'release-*'
tags:
- 'v*'
pull_request:
branches:
- 'main'
- 'release-*'
jobs:
build:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.11", "3.13"]
name: Build packages (Python ${{ matrix.python-version }})
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
fetch-depth: 0 # Needed for proper versioning
- name: Setup Python CI
uses: ./.github/actions/setup-python-ci
with:
python-version: ${{ matrix.python-version }}
- name: Build Package
run: |
echo "Building package (kfp-components)..."
uv build --out-dir dist/
echo "Package built successfully"
ls -lah dist/
- name: Validate Wheel Contents
run: |
echo "Validating package wheel contents..."
for wheel in dist/*.whl; do
python .github/scripts/validate_wheel/validate_wheel.py "$wheel"
done
- name: Create test environment
run: |
uv venv test-env
echo "Virtual environment created"
- name: Test Package Installation and Imports
run: |
echo "Installing package..."
uv pip install --python test-env dist/*.whl
echo "Testing package imports..."
test-env/bin/python .github/scripts/package_imports/package_imports.py
- name: Validate Package Metadata
run: |
echo "Extracting and validating package metadata..."
for wheel in dist/*.whl; do
echo "Validating package metadata: $wheel"
python .github/scripts/validate_wheel/validate_wheel.py "$wheel"
done
- name: Upload Package Artifacts
uses: actions/upload-artifact@v7
with:
name: package-py${{ matrix.python-version }}
path: dist/
retention-days: 30