Skip to content

Bump FileTypeMapper cache key to discard entries poisoned by comment-… #4273

Bump FileTypeMapper cache key to discard entries poisoned by comment-…

Bump FileTypeMapper cache key to discard entries poisoned by comment-… #4273

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@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
egress-policy: audit
- name: "Checkout"
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: "Install PHP"
uses: "shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240" # 2.37.2
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@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
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@e6de054238d6b7531b4efff3b6587d9aade6a06c # v6.2.3
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