Repository navigation
Test Latest Citus Package Installation on Supported PostgreSQL Versions #8
Workflow file for this run
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 Latest Citus Package Installation on Supported PostgreSQL Versions | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| citus_version: | |
| description: "Citus full version (e.g., 14.0.0)" | |
| required: true | |
| type: string | |
| env: | |
| # Branch whose build-package.yml and postgres-matrix.yml are the source of truth | |
| SOURCE_BRANCH: "all-citus" | |
| jobs: | |
| discover: | |
| name: Discover platforms & versions | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.build_matrix.outputs.matrix }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Fetch source branch | |
| run: git fetch origin "${SOURCE_BRANCH}" --depth=1 | |
| - name: Extract platform list | |
| id: extract_platforms | |
| run: | | |
| git show "origin/${SOURCE_BRANCH}:.github/workflows/build-package.yml" \ | |
| > /tmp/build-package.yml | |
| platforms=$( | |
| yq -o=json '.jobs.build_package.strategy.matrix.platform' /tmp/build-package.yml \ | |
| | jq -c '.' | |
| ) | |
| echo "Discovered platforms: ${platforms}" | |
| echo "platforms=${platforms}" >> "$GITHUB_OUTPUT" | |
| - name: Resolve PG versions from postgres-matrix.yml | |
| id: resolve_versions | |
| run: | | |
| git show "origin/${SOURCE_BRANCH}:postgres-matrix.yml" > /tmp/postgres-matrix.yml | |
| citus_version="${{ inputs.citus_version }}" | |
| # Validate x.y.z format | |
| if ! [[ "$citus_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "::error::citus_version must be in x.y.z format (e.g., 14.0.0), got: ${citus_version}" | |
| exit 1 | |
| fi | |
| # Extract major.minor for postgres-matrix.yml lookup | |
| citus_major_minor="${citus_version%.*}" | |
| pg_versions=$( | |
| yq -o=json \ | |
| ".version_matrix[] | select(has(\"${citus_major_minor}\")).\"${citus_major_minor}\".postgres_versions" \ | |
| /tmp/postgres-matrix.yml \ | |
| | jq -c '[.[] | tostring]' | |
| ) | |
| if [[ -z "$pg_versions" || "$pg_versions" == "null" ]]; then | |
| echo "::error::No entry found for Citus ${citus_major_minor} in postgres-matrix.yml" | |
| exit 1 | |
| fi | |
| echo "Citus version: ${citus_version} (major.minor: ${citus_major_minor})" | |
| echo "Supported PG versions: ${pg_versions}" | |
| echo "pg_versions=${pg_versions}" >> "$GITHUB_OUTPUT" | |
| - name: Build matrix | |
| id: build_matrix | |
| run: | | |
| matrix=$(jq -cn \ | |
| --argjson platforms '${{ steps.extract_platforms.outputs.platforms }}' \ | |
| --argjson pg_versions '${{ steps.resolve_versions.outputs.pg_versions }}' \ | |
| '{"platform": $platforms, "pg_version": $pg_versions}') | |
| echo "Matrix: ${matrix}" | |
| echo "matrix=${matrix}" >> "$GITHUB_OUTPUT" | |
| test_package: | |
| name: "PG${{ matrix.pg_version }}/Citus${{ inputs.citus_version }} - ${{ matrix.platform }}" | |
| needs: discover | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.discover.outputs.matrix) }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ">=3.10" | |
| - name: Run package installation test | |
| run: | | |
| python3 test_package_installation/run_test.py \ | |
| "${{ matrix.platform }}" \ | |
| "${{ matrix.pg_version }}" \ | |
| "${{ inputs.citus_version }}" |