Skip to content

Commit 399fd33

Browse files
committed
Use PHPCS, test multiple PHP versions
1 parent aedd207 commit 399fd33

File tree

6 files changed

+47
-32
lines changed

6 files changed

+47
-32
lines changed

.github/workflows/main.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# https://freek.dev/1546-using-github-actions-to-run-the-tests-of-laravel-projects-and-packages
12
# This is a basic workflow to help you get started with Actions
23
name: CI
34

@@ -11,13 +12,30 @@ jobs:
1112
# The type of runner that the job will run on
1213
runs-on: ubuntu-latest
1314

15+
strategy:
16+
matrix:
17+
php: [7.4, 7.3, 7.2, 7.1, 7.0]
18+
19+
name: P${{ matrix.php }}
20+
1421
# Steps represent a sequence of tasks that will be executed as part of the job
1522
steps:
1623
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
17-
- uses: actions/checkout@v2
24+
- name: Checkout code
25+
uses: actions/checkout@v2
26+
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php }}
31+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv
32+
coverage: none
1833

1934
- name: Install Dependencies (PHP vendors)
2035
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --dev
2136

37+
- name: Run code quality checks
38+
run: ./vendor/bin/phpcs
39+
2240
- name: Execute tests via PHPUnit
2341
run: vendor/bin/phpunit

.php_cs

Lines changed: 0 additions & 28 deletions
This file was deleted.

.phpcs.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Laravel CSV Seeder">
3+
<description>The coding standard for Laravel CSV Seeder.</description>
4+
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
5+
<!--
6+
Exceptions to the PSR-2 guidelines as per our Developer Guide:
7+
https://octobercms.com/help/guidelines/developer#psr-exceptions
8+
-->
9+
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
10+
</rule>
11+
12+
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
13+
<!--
14+
Migrations and tests do not need a namespace defined
15+
-->
16+
<exclude-pattern>*/tests/migrations/*\.php</exclude-pattern>
17+
</rule>
18+
19+
<file>src/</file>
20+
<file>tests/</file>
21+
22+
<!-- Ignore vendor files -->
23+
<exclude-pattern>*/vendor/*</exclude-pattern>
24+
</ruleset>

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
"minimum-stability": "dev",
2222
"require-dev": {
23-
"orchestra/testbench": "^6.0@dev"
23+
"orchestra/testbench": "^6.0@dev",
24+
"squizlabs/php_codesniffer": "3.*"
2425
}
2526
}

tests/CsvTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,4 +353,4 @@ public function it_offsets()
353353
'age' => 54
354354
]);
355355
}
356-
}
356+
}

tests/migrations/2014_10_12_000000_create_tests_users_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ public function down()
2929
{
3030
Schema::drop('tests_users');
3131
}
32-
}
32+
}

0 commit comments

Comments
 (0)