Harden public CI validation #5
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: CI | |
| on: | |
| push: | |
| branches: [main, "runapi-ci/**"] | |
| tags: ["v*", "*/v*"] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| defaults: | |
| run: | |
| shell: bash | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| composer: | |
| name: PHP ${{ matrix.php-version }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: ['8.2', '8.3', '8.4', '8.5'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@b604ade2a87db23f8871b7182e69ec5e75effb45 # v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| tools: composer | |
| - name: Validate package metadata | |
| run: composer validate --strict | |
| - name: Configure core package repository | |
| run: composer config repositories.runapi-core vcs https://github.com/runapi-ai/core-php | |
| - name: Install dependencies | |
| run: composer install --no-interaction --prefer-dist | |
| - name: Check PHP syntax | |
| run: find src tests -name '*.php' -print0 | xargs -0 -n1 php -l | |
| - name: Test | |
| run: composer test |