Skip to content

PHPStan should not crash on startup when projects' composer.json is i… #3996

PHPStan should not crash on startup when projects' composer.json is i…

PHPStan should not crash on startup when projects' composer.json is i… #3996

Workflow file for this run

# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: "API Reference"
on:
workflow_dispatch:
push:
branches:
- "2.2.x"
paths:
- 'src/**'
- 'composer.lock'
- 'apigen/**'
- '!apigen/infra/**'
- '.github/workflows/apiref.yml'
env:
COMPOSER_ROOT_VERSION: "2.2.x-dev"
concurrency:
group: apigen-${{ github.ref }} # will be canceled on subsequent pushes in branch
cancel-in-progress: true
jobs:
apigen:
name: "Run ApiGen"
runs-on: "ubuntu-latest"
timeout-minutes: 60
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: "Checkout"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: "Install PHP"
uses: "shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc" # v2.37.1
with:
coverage: "none"
php-version: "8.2"
- uses: "ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda" # v4.0.0
- name: "Install ApiGen dependencies"
uses: "ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda" # v4.0.0
with:
working-directory: "apigen"
- name: "Run ApiGen"
run: "apigen/vendor/bin/apigen -c apigen/apigen.neon --output docs -- src vendor/nikic/php-parser vendor/ondrejmirtes/better-reflection vendor/phpstan/phpdoc-parser"
- name: "Upload docs"
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: docs
path: docs
deploy:
name: "Deploy"
needs:
- apigen
if: github.repository_owner == 'phpstan'
runs-on: "ubuntu-latest"
permissions:
id-token: write
contents: read
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: "Download docs"
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: docs
path: docs
- name: "Configure AWS credentials"
uses: aws-actions/configure-aws-credentials@d979d5b3a71173a29b74b5b88418bfda9437d885 # v6.1.1
with:
role-to-assume: ${{ vars.APIREF_DEPLOY_ROLE_ARN }}
aws-region: us-east-1
- name: "Sync with S3"
run: |
aws s3 sync ./docs "s3://${{ vars.APIREF_BUCKET }}/${{ github.ref_name }}" \
--exclude '.git*/*' \
--follow-symlinks
- name: "Invalidate CloudFront"
run: |
aws cloudfront create-invalidation \
--distribution-id "${{ vars.APIREF_DISTRIBUTION_ID }}" \
--paths "/${{ github.ref_name }}/*"
- uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
with:
token: ${{ secrets.PHPSTAN_BOT_TOKEN }}
repository: "phpstan/phpstan"
event-type: check_website_links
- name: "Check for broken links"
uses: ScholliYT/Broken-Links-Crawler-Action@21eab52f98097989d343116dbbd46dc4541b849b # v3.3.2
with:
website_url: 'https://apiref.phpstan.org/${{ github.ref_name }}/index.html'
resolve_before_filtering: 'true'
verbose: 'warning'
max_retry_time: 30
max_retries: 5