Skip to content

Commit dde535a

Browse files
authored
create php.yml
1 parent 21b5a3a commit dde535a

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

.github/workflows/php.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PHP Composer
1+
name: PHP CI
22

33
on:
44
push:
@@ -15,25 +15,19 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v4
18+
- name: Checkout Code
19+
uses: actions/checkout@v4
1920

20-
- name: Validate composer.json and composer.lock
21-
run: composer validate --strict
22-
23-
- name: Cache Composer packages
24-
id: composer-cache
25-
uses: actions/cache@v3
21+
- name: Set up PHP
22+
uses: shivammathur/setup-php@v2
2623
with:
27-
path: vendor
28-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
29-
restore-keys: |
30-
${{ runner.os }}-php-
24+
php-version: '8.0' # Replace with the PHP version you are using
25+
extensions: mbstring, intl
3126

32-
- name: Install dependencies
33-
run: composer install --prefer-dist --no-progress
27+
- name: Run PHP Syntax Check
28+
run: php -l index.php # Replace `index.php` with your main PHP file or adjust to check all files
3429

35-
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
36-
# Docs: https://getcomposer.org/doc/articles/scripts.md
30+
# Optional: Add PHP tests if applicable
31+
# - name: Run Tests
32+
# run: phpunit tests # Adjust the path if you have a testing framework
3733

38-
# - name: Run test suite
39-
# run: composer run-script test

0 commit comments

Comments
 (0)