feat: intel mac support (#5) #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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')" |