.gitmessage use #50
This file contains 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
# This file is part of the sshilko/php-api-myrpc package. | |
# | |
# (c) Sergei Shilko <contact@sshilko.com> | |
# | |
# MIT License | |
# | |
# For the full copyright and license information, please view the LICENSE | |
# file that was distributed with this source code. | |
# @license https://opensource.org/licenses/mit-license.php MIT | |
name: Psalm | |
on: | |
push: | |
branches: [ "master" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, 'skip-ci')" | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: PHP setup | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.1' | |
extensions: simplexml,dom,xml,intl,ast,mysql,xdebug | |
coverage: xdebug | |
- name: Validate composer.json and composer.lock | |
run: composer validate | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php-${{ hashFiles('/composer.lock') }}-composer-dev | |
- name: PHP Version | |
run: php --version | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress --optimize-autoloader | |
# Docs: https://github.com/psalm/shepherd | |
- name: Run psalm suite and send shepherd stats psalm.dev | |
run: composer app-psalm -- --shepherd > $PWD/build/tmp/psalm.stdout.txt | |
- name: Echo psalm output | |
run: cat $PWD/build/tmp/psalm.stdout.txt | |
# https://github.com/actions/upload-artifact | |
- name: Upload Psalm artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
retention-days: 1 | |
name: psalm-output | |
path: | | |
build/tmp/psalm.stdout.txt | |
build/tmp/psalm.txt | |
pages: | |
needs: build | |
runs-on: ubuntu-latest | |
timeout-minutes: 2 | |
permissions: write-all | |
steps: | |
# https://github.com/actions/checkout | |
- name: Checkout pages branch | |
uses: actions/checkout@v3 | |
with: | |
ref: pages | |
# https://github.com/marketplace/actions/download-a-build-artifact | |
- name: Download all Psalm artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: psalm-output | |
path: php/psalm | |
- uses: nick-fields/retry@v2 | |
name: Commit php/phpstan | |
continue-on-error: true | |
with: | |
timeout_seconds: 20 | |
max_attempts: 3 | |
retry_on: error | |
command: | | |
git status | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git pull | |
git add php/psalm/* | |
git commit -m "generated psalm docs from revision ${GITHUB_SHA::7}" | |
git push |