add ADBC tests for Go, C#, Java, Kotlin, Python, Clojure #118
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: Test All Languages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Start XTDB with Flight SQL | |
| run: | | |
| # Start XTDB container with custom config that enables Flight SQL | |
| docker run -d --name xtdb \ | |
| -p 5432:5432 -p 8080:8080 -p 9833:9833 \ | |
| -v ${{ github.workspace }}/.github/xtdb-ci.yaml:/config/xtdb.yaml:ro \ | |
| ghcr.io/xtdb/xtdb:edge \ | |
| -f /config/xtdb.yaml | |
| # Wait for XTDB to be ready | |
| for i in {1..60}; do | |
| if curl --silent --fail http://localhost:8080/healthz/alive 2>/dev/null; then | |
| echo "XTDB is ready" | |
| break | |
| fi | |
| echo "Waiting for XTDB... ($i/60)" | |
| sleep 2 | |
| done | |
| # Verify it started | |
| if ! curl --silent --fail http://localhost:8080/healthz/alive; then | |
| echo "XTDB did not start in time" | |
| docker logs xtdb | |
| exit 1 | |
| fi | |
| - name: Pull Archlinux container | |
| run: docker pull archlinux:base | |
| - name: Run tests in Archlinux container | |
| run: | | |
| docker run --rm \ | |
| --network host \ | |
| -v ${{ github.workspace }}:/workspace \ | |
| -w /workspace \ | |
| -e XTDB_HOST=localhost \ | |
| -e XTDB_PORT=5432 \ | |
| -e XTDB_USER=xtdb \ | |
| -e XTDB_PASSWORD=xtdb \ | |
| -e XTDB_DATABASE=xtdb \ | |
| -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \ | |
| archlinux:base \ | |
| bash -c ' | |
| set -e | |
| # Install essential deps | |
| chmod +x /workspace/.devcontainer/install-system-deps.sh | |
| /workspace/.devcontainer/install-system-deps.sh essential | |
| # Create test user | |
| useradd -m -s /bin/bash -u 1001 runner | |
| echo "runner ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | |
| # Install mise | |
| cp /workspace/.devcontainer/setup-mise.sh /tmp/setup-mise.sh | |
| chmod +x /tmp/setup-mise.sh | |
| su - runner -c "/tmp/setup-mise.sh runner /workspace" | |
| # Install language runtimes | |
| chown -R runner:runner /workspace | |
| su - runner -c "cd /workspace && ~/.local/bin/mise install" | |
| # Install language-specific tools | |
| su - runner -c "cd /workspace && for dir in python csharp babashka; do | |
| if [ -d \"\$dir\" ] && [ -f \"\$dir/.mise.toml\" ]; then | |
| echo \"Installing mise tools for \$dir...\" | |
| (cd \"\$dir\" && ~/.local/bin/mise install) || echo \"Warning: Failed to install tools for \$dir\" | |
| fi | |
| done" | |
| # Install system packages for Ruby, Elixir, PHP | |
| /workspace/.devcontainer/install-system-deps.sh languages | |
| # Setup Clojure, Elixir, PHP | |
| cp /workspace/.devcontainer/setup-language-tools.sh /tmp/setup-language-tools.sh | |
| chmod +x /tmp/setup-language-tools.sh | |
| su - runner -c "/tmp/setup-language-tools.sh all" | |
| # Install language dependencies | |
| su - runner -c "cd /workspace && \ | |
| eval \"\$(~/.local/bin/mise activate bash)\" && \ | |
| for dir in python node ruby go elixir php; do | |
| if [ -d \"\$dir\" ]; then | |
| echo \"Installing dependencies for \$dir...\" | |
| (cd \"\$dir\" && ~/.local/bin/mise run deps 2>&1) || echo \"Warning: Failed to install deps for \$dir\" | |
| fi | |
| done" | |
| # Verify XTDB connection | |
| /workspace/.devcontainer/install-system-deps.sh postgres | |
| PGPASSWORD=xtdb su - runner -c "psql -h localhost -U xtdb -d xtdb -c \"SELECT 1\"" || echo "PostgreSQL connection test failed" | |
| # Run all tests | |
| su - runner -c "cd /workspace && \ | |
| export XTDB_HOST=localhost && \ | |
| export XTDB_PORT=5432 && \ | |
| export XTDB_USER=xtdb && \ | |
| export XTDB_PASSWORD=xtdb && \ | |
| export XTDB_DATABASE=xtdb && \ | |
| eval \"\$(~/.local/bin/mise activate bash)\" && \ | |
| ~/.local/bin/mise run test:all" | |
| ' | |
| - name: Upload Test Results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: | | |
| **/test-results/ | |
| **/coverage/ | |
| retention-days: 7 | |
| - name: Show XTDB logs on failure | |
| if: failure() | |
| run: docker logs xtdb |