Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 36db45d

Browse files
committed
Improve workflows.
1 parent 2084f56 commit 36db45d

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

.github/workflows/lint.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: lint
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, 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}/Cvd.php")
31+
lintPaths+=("${GITHUB_WORKSPACE}/SigTool.php")
32+
lintPaths+=("${GITHUB_WORKSPACE}/YAML.php")
33+
for lintPath in "${lintPaths[@]}"
34+
do
35+
for file in `find "$lintPath"`
36+
do
37+
EXTENSION="${file##*.}"
38+
if [ "$EXTENSION" == "php" ]
39+
then
40+
RESULTS=`php -l "$file"`
41+
if [ "$RESULTS" != "No syntax errors detected in $file" ]
42+
then
43+
echo $RESULTS
44+
fi
45+
fi
46+
done
47+
done

.github/workflows/php-cs-fixer.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
operating-system: [ubuntu-latest]
12-
php-versions: ['7.2', '7.3', '7.4', '8.0']
12+
php-versions: ['8.0']
1313
name: PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
1414
steps:
1515
- name: Checkout
@@ -23,4 +23,6 @@ jobs:
2323
tools: php-cs-fixer
2424

2525
- name: PHP-CS-Fixer Check
26-
run: php-cs-fixer fix -v --dry-run ./SigTool.php --rules=@PSR12
26+
run: |
27+
php-cs-fixer fix -v --dry-run ./SigTool.php --rules=@PSR12
28+
php-cs-fixer fix -v --dry-run ./Cvd.php --rules=@PSR12

0 commit comments

Comments
 (0)