2023-03-25 04:54:14 +00:00
|
|
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
|
|
|
|
|
|
|
name: lint
|
|
|
|
|
|
|
|
on:
|
|
|
|
- push
|
|
|
|
- workflow_dispatch
|
2023-03-25 08:26:53 +00:00
|
|
|
- pull_request
|
2023-03-25 04:54:14 +00:00
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: sh
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
runs-on: alpine-3.16
|
|
|
|
steps:
|
|
|
|
- name: checkout source
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-03-25 07:23:36 +00:00
|
|
|
- name: calculate cache key hash
|
|
|
|
uses: actions/go-hashfiles@v0.0.1
|
|
|
|
id: cache-hash
|
|
|
|
with:
|
|
|
|
patterns: |
|
|
|
|
classes/*.php
|
|
|
|
include/*.php
|
|
|
|
plugins/**/*.php
|
|
|
|
|
2023-03-25 04:54:14 +00:00
|
|
|
- name: phpunit
|
|
|
|
run: php81 ./vendor/bin/phpunit
|
|
|
|
|
2023-03-25 07:23:36 +00:00
|
|
|
- uses: https://github.com/actions/cache/restore@v3
|
|
|
|
id: cache-phpstan
|
|
|
|
with:
|
|
|
|
path: /tmp/phpstan
|
|
|
|
key: ${{ runner.os }}-phpstan-${{ steps.cache-hash.outputs.hash }}
|
|
|
|
|
2023-03-25 04:54:14 +00:00
|
|
|
- name: phpstan
|
|
|
|
run: php81 -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G
|
2023-03-25 07:23:36 +00:00
|
|
|
|
|
|
|
- uses: https://github.com/actions/cache/save@v3
|
|
|
|
with:
|
|
|
|
path: /tmp/phpstan
|
|
|
|
key: ${{ steps.cache-phpstan.outputs.cache-primary-key }}
|