docs: adicionar template de pull request #1071
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: Continuous Integration | |
| on: | |
| pull_request: | |
| branches: | |
| - '*.x' | |
| - 'feature/**' | |
| - 'feat/**' | |
| - 'bugfix/**' | |
| - 'chore/**' | |
| - 'story/**' | |
| types: [opened, reopened, synchronize, ready_for_review] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| setup: | |
| name: Setup PHP | |
| runs-on: ubuntu-latest | |
| if: ${{ !github.event.pull_request.draft }} | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: read | |
| outputs: | |
| CACHE_KEY: ${{ steps.cache.outputs.key }} | |
| PHP_VERSION: ${{ steps.setup.outputs.PHP_VERSION }} | |
| PHP_EXTENSIONS: ${{ steps.setup.outputs.PHP_EXTENSIONS }} | |
| PHP_INI_PROPERTIES: ${{ steps.setup.outputs.PHP_INI_PROPERTIES }} | |
| COMPOSER_FLAGS: ${{ steps.setup.outputs.COMPOSER_FLAGS }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup job outputs | |
| id: setup | |
| run: | | |
| echo "PHP_VERSION=8.4" >> "$GITHUB_OUTPUT" | |
| echo "PHP_EXTENSIONS=mbstring,pdo,pdo_pgsql,xml,ctype,fileinfo,json,curl,openssl,dom,zip" >> "$GITHUB_OUTPUT" | |
| echo "PHP_INI_PROPERTIES=post_max_size=256M,upload_max_filesize=256M" >> "$GITHUB_OUTPUT" | |
| echo "COMPOSER_FLAGS=--prefer-dist --optimize-autoloader" >> "$GITHUB_OUTPUT" | |
| - name: Create cache key | |
| id: cache | |
| shell: bash | |
| env: | |
| RUNNER_OS: ${{ runner.os }} | |
| RUNNER_ARCH: ${{ runner.arch }} | |
| HASHED_COMPOSER_LOCK: ${{ hashFiles('composer.lock') }} | |
| run: | | |
| composer_hash=${HASHED_COMPOSER_LOCK} | |
| os_lower=$(echo ${RUNNER_OS} | tr '[:upper:]' '[:lower:]') | |
| arch_lower=$(echo ${RUNNER_ARCH} | tr '[:upper:]' '[:lower:]') | |
| combined_key="${os_lower}-${arch_lower}-composer-${composer_hash}" | |
| echo "key=${combined_key}" >> "$GITHUB_OUTPUT" | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2 | |
| with: | |
| php-version: ${{ steps.setup.outputs.PHP_VERSION }} | |
| extensions: ${{ steps.setup.outputs.PHP_EXTENSIONS }} | |
| ini-values: ${{ steps.setup.outputs.PHP_INI_PROPERTIES }} | |
| coverage: xdebug | |
| tools: composer:v2 | |
| - name: Install composer dependencies | |
| uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4.0.0 | |
| with: | |
| composer-options: ${{ steps.setup.outputs.COMPOSER_FLAGS }} | |
| custom-cache-key: ${{ steps.cache.outputs.key }} | |
| pint: | |
| name: Perform Pint format | |
| needs: [setup] | |
| if: ${{ !github.event.pull_request.draft }} | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/_pint.yml | |
| with: | |
| CACHE_KEY: ${{ needs.setup.outputs.CACHE_KEY }} | |
| COMPOSER_FLAGS: ${{ needs.setup.outputs.COMPOSER_FLAGS }} | |
| PHP_EXTENSIONS: ${{ needs.setup.outputs.PHP_EXTENSIONS }} | |
| PHP_INI_PROPERTIES: ${{ needs.setup.outputs.PHP_INI_PROPERTIES }} | |
| PHP_VERSION: ${{ needs.setup.outputs.PHP_VERSION }} | |
| rector: | |
| name: Perform Rector Check | |
| needs: [setup] | |
| if: ${{ !github.event.pull_request.draft }} | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/_rector.yml | |
| with: | |
| CACHE_KEY: ${{ needs.setup.outputs.CACHE_KEY }} | |
| COMPOSER_FLAGS: ${{ needs.setup.outputs.COMPOSER_FLAGS }} | |
| PHP_EXTENSIONS: ${{ needs.setup.outputs.PHP_EXTENSIONS }} | |
| PHP_INI_PROPERTIES: ${{ needs.setup.outputs.PHP_INI_PROPERTIES }} | |
| PHP_VERSION: ${{ needs.setup.outputs.PHP_VERSION }} | |
| phpstan: | |
| name: Perform Phpstan Check | |
| needs: [setup] | |
| if: ${{ !github.event.pull_request.draft }} | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/_phpstan.yml | |
| with: | |
| CACHE_KEY: ${{ needs.setup.outputs.CACHE_KEY }} | |
| COMPOSER_FLAGS: ${{ needs.setup.outputs.COMPOSER_FLAGS }} | |
| PHP_EXTENSIONS: ${{ needs.setup.outputs.PHP_EXTENSIONS }} | |
| PHP_INI_PROPERTIES: ${{ needs.setup.outputs.PHP_INI_PROPERTIES }} | |
| PHP_VERSION: ${{ needs.setup.outputs.PHP_VERSION }} | |
| pest: | |
| name: Perform Pest Tests | |
| needs: [setup] | |
| if: ${{ !github.event.pull_request.draft }} | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/_pest.yml | |
| with: | |
| CACHE_KEY: ${{ needs.setup.outputs.CACHE_KEY }} | |
| COMPOSER_FLAGS: ${{ needs.setup.outputs.COMPOSER_FLAGS }} | |
| PHP_EXTENSIONS: ${{ needs.setup.outputs.PHP_EXTENSIONS }} | |
| PHP_INI_PROPERTIES: ${{ needs.setup.outputs.PHP_INI_PROPERTIES }} | |
| PHP_VERSION: ${{ needs.setup.outputs.PHP_VERSION }} | |
| gate: | |
| name: CI Gate | |
| needs: [setup, pint, rector, phpstan, pest] | |
| if: ${{ always() && !github.event.pull_request.draft }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: {} | |
| steps: | |
| - name: Require every check to succeed | |
| env: | |
| RESULTS: ${{ join(needs.*.result, ', ') }} | |
| run: | | |
| echo "Dependency results: ${RESULTS}" | |
| for result in ${RESULTS//,/ }; do | |
| if [ "${result}" != "success" ]; then | |
| echo "::error::CI did not pass cleanly (${RESULTS})." | |
| exit 1 | |
| fi | |
| done | |
| echo "All CI checks passed." |