|
| 1 | +name: Test Package Installation |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + pg_major_version: |
| 7 | + description: "PostgreSQL major version (e.g., 18)" |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + citus_major_minor_version: |
| 11 | + description: "Citus major.minor version (e.g., 14.0)" |
| 12 | + required: true |
| 13 | + type: string |
| 14 | + |
| 15 | +env: |
| 16 | + # Branch whose build-package.yml defines the canonical platform list |
| 17 | + SOURCE_BRANCH: "all-citus" |
| 18 | + |
| 19 | +jobs: |
| 20 | + discover_platforms: |
| 21 | + name: Discover supported platforms |
| 22 | + runs-on: ubuntu-latest |
| 23 | + outputs: |
| 24 | + matrix: ${{ steps.extract.outputs.matrix }} |
| 25 | + steps: |
| 26 | + - name: Checkout repository |
| 27 | + uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: Extract platform list from build-package.yml |
| 30 | + id: extract |
| 31 | + run: | |
| 32 | + # Fetch only the all-citus branch (shallow) to read its build-package.yml |
| 33 | + git fetch origin "${SOURCE_BRANCH}" --depth=1 |
| 34 | + git show "origin/${SOURCE_BRANCH}:.github/workflows/build-package.yml" \ |
| 35 | + > /tmp/build-package.yml |
| 36 | +
|
| 37 | + # Pull the platform array and compact it into a single-line JSON string |
| 38 | + platforms=$( |
| 39 | + yq -o=json '.jobs.build_package.strategy.matrix.platform' /tmp/build-package.yml \ |
| 40 | + | jq -c '.' |
| 41 | + ) |
| 42 | +
|
| 43 | + echo "Discovered platforms: ${platforms}" |
| 44 | + echo "matrix={\"platform\": ${platforms}}" >> "$GITHUB_OUTPUT" |
| 45 | +
|
| 46 | + test_package: |
| 47 | + name: "Test ${{ matrix.platform }}" |
| 48 | + needs: discover_platforms |
| 49 | + runs-on: ubuntu-latest |
| 50 | + strategy: |
| 51 | + fail-fast: false |
| 52 | + matrix: ${{ fromJson(needs.discover_platforms.outputs.matrix) }} |
| 53 | + steps: |
| 54 | + - name: Checkout repository |
| 55 | + uses: actions/checkout@v4 |
| 56 | + |
| 57 | + - name: Set up Python |
| 58 | + uses: actions/setup-python@v5 |
| 59 | + with: |
| 60 | + python-version: ">=3.10" |
| 61 | + |
| 62 | + - name: Run package installation test |
| 63 | + run: | |
| 64 | + python3 test_package_installation/run_test.py \ |
| 65 | + "${{ matrix.platform }}" \ |
| 66 | + "${{ inputs.pg_major_version }}" \ |
| 67 | + "${{ inputs.citus_major_minor_version }}" |
0 commit comments