Skip to content

Commit 5e008d0

Browse files
authored
Add simple linter
Add simple linter
2 parents fc0a4de + 44d75c1 commit 5e008d0

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

.github/workflows/sumplelinter.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: linter
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ main ]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
linter:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
php-versions: [ '7.2' ]
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
name: Checkout
21+
22+
- uses: eWaterCycle/setup-grpc@v5
23+
name: Setup gRPC
24+
with:
25+
grpc-version: 1.51.1
26+
27+
- uses: shivammathur/setup-php@v2
28+
name: Setup PHP
29+
id: php
30+
with:
31+
extensions: grpc
32+
php-version: ${{ matrix.php-versions }}
33+
34+
- run: composer validate --strict
35+
name: Validate composer.json and composer.lock
36+
37+
- uses: actions/cache@v3
38+
name: Cache Composer packages
39+
id: composer-cache
40+
41+
with:
42+
path: vendor
43+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
44+
restore-keys: |
45+
${{ runner.os }}-php-
46+
- name: Install dependencies
47+
run: composer install --prefer-dist --no-progress
48+
49+
- name: Run tests
50+
run: ./vendor/bin/phplint \
51+
./ --exclude=vendor

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"psr/log": "^1|^2|^3"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": ">= 6.0, <10.0"
23+
"phpunit/phpunit": ">= 6.0, <10.0",
24+
"overtrue/phplint": "^3.0"
2425
},
2526
"autoload": {
2627
"psr-4": {

0 commit comments

Comments
 (0)