Skip to content

Commit 3c2babe

Browse files
committed
Improve workflows.
1 parent a0daab6 commit 3c2babe

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/cli.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: cli
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.operating-system }}
8+
9+
strategy:
10+
matrix:
11+
operating-system: [ubuntu-latest]
12+
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1']
13+
name: PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Set up PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php-versions }}
22+
extensions: pcre, apcu, curl
23+
24+
- name: Validate composer.json and composer.lock
25+
run: composer validate
26+
27+
- name: Lint
28+
run: |
29+
lintPaths=()
30+
lintPaths+=("${GITHUB_WORKSPACE}/src")
31+
for lintPath in "${lintPaths[@]}"
32+
do
33+
for file in `find "$lintPath"`
34+
do
35+
EXTENSION="${file##*.}"
36+
if [ "$EXTENSION" == "php" ]
37+
then
38+
RESULTS=`php -l "$file"`
39+
if [ "$RESULTS" != "No syntax errors detected in $file" ]
40+
then
41+
echo $RESULTS
42+
fi
43+
fi
44+
done
45+
done

0 commit comments

Comments
 (0)