-
Notifications
You must be signed in to change notification settings - Fork 7
130 lines (106 loc) · 3.56 KB
/
Copy pathci.yml
File metadata and controls
130 lines (106 loc) · 3.56 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
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: Build CLI
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --release
- name: Upload CLI artifact
uses: actions/upload-artifact@v4
with:
name: pg0-macos
path: target/release/pg0
sdk-tests:
name: SDK Tests (macOS)
needs: build
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Download CLI
uses: actions/download-artifact@v4
with:
name: pg0-macos
path: ~/.local/bin
- name: Make CLI executable
run: chmod +x ~/.local/bin/pg0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Run Python SDK tests
working-directory: sdk/python
run: |
export PATH="$HOME/.local/bin:$PATH"
uv pip install --system -e ".[dev]"
pytest tests/ -v
# Docker tests - one job per platform, runs both CLI and Python SDK tests
# Note: ARM64 tests are skipped because QEMU emulation is too slow for PostgreSQL setup
docker-tests:
name: Docker Tests (${{ matrix.platform }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- platform: debian-amd64
cli_script: docker-tests/test_debian_amd64.sh
python_script: docker-tests/python/test_debian_amd64.sh
- platform: alpine-amd64
cli_script: docker-tests/test_alpine_amd64.sh
python_script: docker-tests/python/test_alpine_amd64.sh
steps:
- uses: actions/checkout@v4
- name: Run CLI Docker test
run: |
chmod +x ${{ matrix.cli_script }}
bash ${{ matrix.cli_script }}
- name: Run Python SDK Docker test
run: |
chmod +x ${{ matrix.python_script }}
bash ${{ matrix.python_script }}
# Python wheel builds - test that wheel building works
python-wheels:
name: Python Wheels
uses: ./.github/workflows/build-python-wheels.yml
with:
upload-artifacts: false
test-wheels: true
# Test installing from sdist (source distribution)
python-sdist-install:
name: Python sdist Install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Build sdist
working-directory: sdk/python
run: uv build --sdist
- name: Install from sdist in isolated environment
run: |
# Create a fresh directory outside the repo to simulate user install
mkdir /tmp/sdist-test
cp sdk/python/dist/*.tar.gz /tmp/sdist-test/
cd /tmp/sdist-test
# Install from sdist (this should download binary from GitHub releases)
pip install *.tar.gz -v 2>&1 | tee install.log
# Verify the download happened
grep -q "Downloading pg0" install.log || echo "Warning: Download message not found"
# Verify the package works
python -c "from pg0 import Pg0; print('Import successful')"
python -c "from pg0 import _get_bundled_binary; assert _get_bundled_binary() is not None, 'Binary not bundled'; print('Binary bundled correctly')"