Adding reusable test and nightly FMT #1502
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: Build and test PECL package | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| pull_request: {} | |
| workflow_dispatch: | |
| inputs: | |
| full-matrix: | |
| description: "Run the full engine, host, and language version matrix" | |
| type: boolean | |
| default: false | |
| jobs: | |
| validate-version: | |
| name: Validate Version Consistency | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate version consistency | |
| uses: ./.github/workflows/validate-version | |
| get-matrices: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }} | |
| host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }} | |
| version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - id: get-matrices | |
| uses: ./.github/workflows/create-test-matrices | |
| with: | |
| language-name: php | |
| # Run full test matrix if job started by cron or it was explicitly specified by a person who triggered the workflow | |
| run-full-matrix: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }} | |
| test-pecl-install: | |
| name: PECL Tests - ${{ matrix.php }}, EngineVersion - ${{ matrix.engine.version }}, Target - ${{ matrix.host.TARGET }} | |
| needs: [get-matrices, validate-version] | |
| if: always() && (needs.validate-version.result == 'success' || needs.validate-version.result == 'skipped') | |
| timeout-minutes: 35 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ${{ fromJson(needs.get-matrices.outputs.version-matrix-output) }} | |
| engine: ${{ fromJson(needs.get-matrices.outputs.engine-matrix-output) }} | |
| host: ${{ fromJson(needs.get-matrices.outputs.host-matrix-output) }} | |
| runs-on: ${{ matrix.host.RUNNER }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Output Matrix Parameters for this job | |
| run: | | |
| echo "Job running with the following matrix configuration:" | |
| echo "${{ toJson(matrix) }}" | |
| - name: Setup ValkeyGlide with Caching | |
| uses: ./.github/workflows/setup-valkey-glide | |
| with: | |
| php-version: ${{ matrix.php }} | |
| engine-version: ${{ matrix.engine.version }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2 | |
| with: | |
| workspaces: | | |
| valkey-glide/ffi | |
| valkey-glide/glide-core | |
| key: pecl | |
| - name: Pre-populate Rust registry cache | |
| run: | | |
| echo "=== Pre-populating Rust registry cache ===" | |
| # This will download all dependencies to ~/.cargo/registry | |
| cd valkey-glide/ffi | |
| cargo fetch | |
| echo "Registry cache populated" | |
| - name: Test PECL Package Installation | |
| uses: ./.github/workflows/test-pecl-package | |
| with: | |
| php-version: ${{ matrix.php }} | |
| engine-version: ${{ matrix.engine.version }} |