-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (59 loc) · 1.91 KB
/
Copy pathpull-request-check.yml
File metadata and controls
69 lines (59 loc) · 1.91 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
59
60
61
62
63
64
65
66
67
68
69
name: Pull Request Check
on: [pull_request]
jobs:
unit-test:
name: Unit testing
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3.29'
tools: composer
coverage: none
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('composer.lock') }}
- name: Installing dependencies
env:
COMPOSER_CACHE_DIR: /tmp/composer-cache
run: composer install --no-interaction --no-progress --prefer-dist
- name: Running unit test
run: vendor/bin/phpunit --configuration phpunit.xml
php84-syntax-check:
name: PHP 8.4 syntax compatibility
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup PHP 8.4
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
tools: composer
coverage: none
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('composer.lock') }}
- name: Install dependencies
env:
COMPOSER_CACHE_DIR: /tmp/composer-cache
run: composer install --no-interaction --no-progress --prefer-dist
- name: Run Rector dry-run on changed PHP files
run: |
CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- '*.php')
if [ -z "$CHANGED" ]; then
echo "No PHP files changed."
exit 0
fi
echo "Changed PHP files:"
echo "$CHANGED"
vendor/bin/rector process --dry-run --no-progress-bar $CHANGED