-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (90 loc) · 3.04 KB
/
Copy pathphp.yml
File metadata and controls
113 lines (90 loc) · 3.04 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
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
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
jobs:
test:
name: Test (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
matrix:
php: ["8.2", "8.3", "8.4", "8.5"]
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run tests
run: ./vendor/bin/pest
format-check:
name: Check Code Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: "8.2"
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Check formatting
run: composer format:check
production-build:
name: Production Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: "8.2"
coverage: none
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Build production dependencies
run: composer build
- name: Verify production vendor contents
run: |
test -f vendor/autoload.php
for package in vendor/pestphp vendor/phpunit vendor/mockery vendor/friendsofphp vendor/php-stubs; do
if [ -e "$package" ]; then
echo "Unexpected development package in production vendor: $package"
exit 1
fi
done
- name: Verify release package layout
run: |
mkdir -p release
rsync -av --exclude-from=.distignore . release/hellotext-wordpress/
test -f release/hellotext-wordpress/hellotext.php
test -d release/hellotext-wordpress/src
test -f release/hellotext-wordpress/vendor/autoload.php
for path in \
release/hellotext-wordpress/tests \
release/hellotext-wordpress/composer.json \
release/hellotext-wordpress/composer.lock \
release/hellotext-wordpress/.github \
release/hellotext-wordpress/.php-cs-fixer.cache \
release/hellotext-wordpress/.php-cs-fixer.php \
release/hellotext-wordpress/DEVELOPMENT.md \
release/hellotext-wordpress/API.md \
release/hellotext-wordpress/release; do
if [ -e "$path" ]; then
echo "Unexpected development file in release package: $path"
exit 1
fi
done