Skip to content

Update stubs

Update stubs #1330

Workflow file for this run

# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: "Update stubs"
on:
workflow_dispatch:
push:
branches:
- "main"
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0 * * *'
jobs:
update:
name: "Update stubs"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: '0'
token: ${{ secrets.PHPSTAN_BOT_TOKEN }}
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.1"
- name: "Install dependencies"
run: "composer install"
working-directory: ./extractor
- name: "Checkout"
uses: actions/checkout@v4
with:
repository: "php/php-src"
path: "php-src"
ref: "PHP-8.0"
- name: "Extract stubs"
run: "./extractor/extract.php"
# repeat
- name: "Delete checked out php-src repo"
run: "rm -rf php-src"
- name: "Checkout PHP 8.1"
uses: actions/checkout@v4
with:
repository: "php/php-src"
path: "php-src"
ref: "PHP-8.1"
- name: "Update stubs"
run: "./extractor/extract.php --update -- 8.0 8.1"
# ---
- name: "Delete checked out php-src repo"
run: "rm -rf php-src"
- name: "Checkout PHP 8.2"
uses: actions/checkout@v4
with:
repository: "php/php-src"
path: "php-src"
ref: "PHP-8.2"
- name: "Update stubs"
run: "./extractor/extract.php --update -- 8.1 8.2"
# ---
- name: "Delete checked out php-src repo"
run: "rm -rf php-src"
- name: "Checkout PHP 8.3"
uses: actions/checkout@v4
with:
repository: "php/php-src"
path: "php-src"
ref: "PHP-8.3"
- name: "Update stubs"
run: "./extractor/extract.php --update -- 8.2 8.3"
# end repeat
- name: 'Get previous tag'
id: previous_tag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: 0.1.0
- name: 'Get next minor version'
id: semvers
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ steps.previous_tag.outputs.tag }}
- name: "Commit changes"
uses: "stefanzweifel/git-auto-commit-action@v4"
id: "commit"
with:
commit_message: "Update stubs"
commit_user_name: "phpstan-bot"
commit_user_email: "ondrej+phpstanbot@mirtes.cz"
commit_author: "phpstan-bot <ondrej+phpstanbot@mirtes.cz>"
tagging_message: ${{ steps.semvers.outputs.patch }}