-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (50 loc) · 1.48 KB
/
phpstan.yml
File metadata and controls
58 lines (50 loc) · 1.48 KB
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
name: PHPStan Static Analysis
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
phpstan:
name: PHPStan Level 6
runs-on: ubuntu-latest
steps:
- name: Checkout Moodle
uses: actions/checkout@v6
with:
repository: moodle/moodle
ref: MOODLE_405_STABLE
- name: Checkout plugin into Moodle
uses: actions/checkout@v6
with:
path: local/githubsync
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:v2
- name: Create Moodle config
run: |
cat > config.php << 'MOODLECFG'
<?php
$CFG = new stdClass();
$CFG->dirroot = __DIR__;
$CFG->libdir = __DIR__ . '/lib';
$CFG->dataroot = '/tmp/moodledata';
$CFG->wwwroot = 'http://localhost';
$CFG->admin = 'admin';
$CFG->dbtype = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle';
$CFG->dbuser = 'root';
$CFG->dbpass = '';
$CFG->prefix = 'mdl_';
@mkdir('/tmp/moodledata', 0777, true);
MOODLECFG
- name: Install PHPStan
working-directory: local/githubsync
run: composer install --no-interaction
- name: Run PHPStan
working-directory: local/githubsync
run: vendor/bin/phpstan analyse --memory-limit=512M --no-progress