-
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (52 loc) · 1.6 KB
/
code-analysis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Code Analysis
on:
workflow_call:
secrets:
TOKEN:
required: false
description: 'GitHub Token used to install Composer dependencies.'
inputs:
php_version:
description: 'PHP version to be used.'
required: false
type: string
default: '8.3'
larastan_config_file:
description: 'Larastan configuration file.'
required: false
type: string
default: 'phpstan.neon.dist'
custom_commands:
description: 'Custom commands to run.'
required: false
type: string
default: ''
permissions:
contents: write
jobs:
larastan:
if: "!contains(github.event.head_commit.message, 'wip')"
name: Larastan
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php_version }}
tools: composer:v2
extensions: dom, curl, libxml, mbstring, zip, fileinfo
coverage: none
- name: Custom Commands
if: "inputs.custom_commands != ''"
run: ${{ inputs.custom_commands }}
- name: Install Composer Dependencies
uses: ramsey/composer-install@v3
with:
composer-options: "--prefer-dist --optimize-autoloader"
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.TOKEN }}"}}'
- name: Analyse Code
run: ./vendor/bin/phpstan analyse -c ${{ inputs.larastan_config_file }} --memory-limit=-1 --error-format=github