-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.31 KB
/
ci.yml
File metadata and controls
50 lines (42 loc) · 1.31 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
name: PHP CI Pipeline
# Trigger the workflow on push or pull request to the main branch
on:
push:
branches:
- main
pull_request:
branches:
- main
# Jobs to run
jobs:
test:
name: Run PHP Checks
runs-on: ubuntu-latest
steps:
# Check out the repository
- name: Checkout code
uses: actions/checkout@v3
# Set up PHP
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2' # Use the PHP version your project requires
# Lint PHP files (check for syntax errors)
- name: Lint PHP files
run: find . -type f -name '*.php' -exec php -l {} \;
# Download PHP-CS-Fixer
- name: Download PHP-CS-Fixer
run: |
wget https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer.phar
chmod +x php-cs-fixer.phar
# Run PHP-CS-Fixer (fix coding standards)
- name: Run PHP-CS-Fixer
run: ./php-cs-fixer.phar fix --verbose .
# Download PHP_CodeSniffer
- name: Download PHP_CodeSniffer
run: |
wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -O phpcs.phar
chmod +x phpcs.phar
# Run PHP_CodeSniffer (check coding standards)
- name: Run PHP_CodeSniffer
run: ./phpcs.phar --standard=PSR12 .