-
Notifications
You must be signed in to change notification settings - Fork 28
129 lines (129 loc) · 4.46 KB
/
ci.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: CI tests
on: [push, pull_request]
jobs:
phpunit:
strategy:
matrix:
cfg:
- { os: 'ubuntu-20.04', php: '7.4' }
- { os: 'ubuntu-22.04', php: '8.1' }
- { os: 'ubuntu-22.04', php: '8.3' }
runs-on: ${{ matrix.cfg.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP, composer
uses: ./.github/actions/setup-php
with:
php-version: ${{ matrix.cfg.php }}
- name: Setup MySQL, install schema
uses: ./.github/actions/setup-mysql-db
- name: Install aspell dependencies for WordCheck tests
run: sudo apt --fix-broken install aspell aspell-en
- name: Run phpunit tests
run: cd SETUP/tests/unittests && ../../../vendor/bin/phpunit
jsunit:
strategy:
matrix:
cfg:
- { os: 'ubuntu-22.04', php: '8.3' }
runs-on: ${{ matrix.cfg.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node, NPM
uses: ./.github/actions/setup-node
- name: Run js unit tests
run: npm run test
linting:
strategy:
matrix:
cfg:
- { os: 'ubuntu-20.04', php: '7.4' }
- { os: 'ubuntu-22.04', php: '8.1' }
- { os: 'ubuntu-22.04', php: '8.3' }
runs-on: ${{ matrix.cfg.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP, composer
uses: ./.github/actions/setup-php
with:
php-version: ${{ matrix.cfg.php }}
- name: Setup Node, NPM
uses: ./.github/actions/setup-node
- name: Lint PHP code
run: make -C SETUP/ci lint_code
- name: Run JS lint
run: npm run lint
- name: Run JS format check
run: npm run format-check
- name: Run PHP-CS-Fixer and confirm no changes
run: ./vendor/bin/php-cs-fixer fix --show-progress=none --dry-run --diff
phpstan:
# Only run on a single version of Ubuntu/PHP to save GitHub CPU time.
# PHPStan will perform the same checks irrespective of the platform.
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP, composer
uses: ./.github/actions/setup-php
with:
php-version: '8.3'
# We don't install MySQL, but we do need pinc/site_vars.php & co.
# so the static analysis doesn't fail trying to include_once those files.
- name: Configure site setup
run: SETUP/configure SETUP/tests/ci_configuration.sh .
- name: Run PHPStan
run: ./vendor/bin/phpstan --no-ansi --no-progress --memory-limit=512M
misc_checks:
# Only run on a single version of Ubuntu/PHP to save GitHub CPU time.
# The CSS tests don't use PHP, and the other tests either just check
# the source code for regexps, or check for data consistency in the
# character tables.
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP, composer
uses: ./.github/actions/setup-php
with:
php-version: '8.3'
- name: Setup Node, NPM
uses: ./.github/actions/setup-node
- name: Run security checks
run: make -C SETUP/ci security_checks
- name: Run charsuite checks
run: make -C SETUP/ci lint_charsuites
- name: Run less/CSS checks
run: make -C SETUP/ci lint_css
- name: Run best practice checks
run: make -C SETUP/ci best_practice_checks
- name: Run shellcheck on shell scripts
run: make -C SETUP/ci shellcheck
pageload-smoketest:
strategy:
matrix:
cfg:
- { os: 'ubuntu-20.04', php: '7.4' }
- { os: 'ubuntu-22.04', php: '8.1' }
- { os: 'ubuntu-22.04', php: '8.3' }
runs-on: ${{ matrix.cfg.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP, composer
uses: ./.github/actions/setup-php
with:
php-version: ${{ matrix.cfg.php }}
- name: Setup MySQL, install schema
uses: ./.github/actions/setup-mysql-db
- name: Install aspell dependencies for WordCheck tests
run: sudo apt --fix-broken install aspell aspell-en
- name: Setup smoke test environment
run: SETUP/tests/smoketests/smoketest_setup.sh
- name: Run pageload smoketest
run: |
SETUP/tests/smoketests/pageload_smoketest.py \
-u admin -p admin_pass -k admin_key