Skip to content

Commit 92d09e1

Browse files
Merge pull request #24 from clnt/laravel-9-support
Laravel 9 and PHP 8.1 Support with CI
2 parents 571c19b + 02931e1 commit 92d09e1

File tree

3 files changed

+107
-26
lines changed

3 files changed

+107
-26
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- dev
8+
tags:
9+
- '*'
10+
pull_request:
11+
branches: [ master ]
12+
13+
workflow_dispatch:
14+
15+
jobs:
16+
phpcs:
17+
strategy:
18+
matrix:
19+
version: ['7.4', '8.1']
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout the repository
24+
uses: actions/checkout@v2
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Setup PHP with composer v2
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.version }}
32+
tools: composer:v2
33+
34+
- name: Install composer packages
35+
run: |
36+
php -v
37+
composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
38+
39+
- name: Execute PHP_CodeSniffer
40+
run: |
41+
php -v
42+
composer check-style
43+
44+
phpunit:
45+
strategy:
46+
matrix:
47+
version: ['7.4', '8.1']
48+
runs-on: ubuntu-latest
49+
50+
steps:
51+
- name: Checkout the repository
52+
uses: actions/checkout@v2
53+
with:
54+
fetch-depth: 0
55+
56+
- name: Setup PHP
57+
uses: shivammathur/setup-php@v2
58+
with:
59+
php-version: ${{ matrix.version }}
60+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, intl, exif, iconv
61+
coverage: xdebug
62+
63+
- name: Install composer packages
64+
run: |
65+
php -v
66+
composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
67+
68+
- name: Execute tests
69+
run: |
70+
php -v
71+
./vendor/phpunit/phpunit/phpunit --version
72+
./vendor/phpunit/phpunit/phpunit --coverage-clover=coverage.xml
73+
# export CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}
74+
# bash <(curl -s https://codecov.io/bash) || echo 'Codecov failed to upload'
75+
76+
# - name: Upload code coverage
77+
# run: |
78+
# export CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}
79+
# bash <(curl -s https://codecov.io/bash) || echo 'Codecov failed to upload'
80+
81+
package-security-checker:
82+
runs-on: ubuntu-latest
83+
84+
steps:
85+
- name: Checkout the repository
86+
uses: actions/checkout@v2
87+
88+
- name: Setup PHP
89+
uses: shivammathur/setup-php@v2
90+
91+
- name: Install composer packages
92+
run: |
93+
php -v
94+
composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
95+
96+
- name: Install security-checker
97+
run: |
98+
test -d local-php-security-checker || curl -L https://github.com/fabpot/local-php-security-checker/releases/download/v1.2.0/local-php-security-checker_1.2.0_linux_amd64 --output local-php-security-checker
99+
chmod +x local-php-security-checker
100+
./local-php-security-checker

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
}
1515
],
1616
"require": {
17-
"php" : "^7.4",
18-
"illuminate/database": "^8.0",
19-
"illuminate/support": "^8.0"
17+
"php" : "^7.4|^8.1",
18+
"illuminate/database": "^8.0|^9.0",
19+
"illuminate/support": "^8.0|^9.0"
2020
},
2121
"require-dev": {
2222
"mockery/mockery": "^1.0",
23-
"orchestra/database": "^6.0",
24-
"orchestra/testbench": "^6.0",
25-
"phpunit/phpunit": "^8.0",
26-
"squizlabs/php_codesniffer": "^2.3"
23+
"orchestra/database": "^6.0|^7.0",
24+
"orchestra/testbench": "^6.0|^7.0",
25+
"phpunit/phpunit": "^8.0|^9.0",
26+
"squizlabs/php_codesniffer": "^3.3"
2727
},
2828
"autoload": {
2929
"psr-4": {

phpunit.xml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,4 @@
1717
<directory>tests/Integration</directory>
1818
</testsuite>
1919
</testsuites>
20-
<filter>
21-
<whitelist>
22-
<directory suffix=".php">src/</directory>
23-
<exclude>
24-
<directory suffix=".php">src/Facade</directory>
25-
<directory suffix=".php">src/Featurable</directory>
26-
<directory suffix=".php">src/Provider</directory>
27-
<directory suffix=".php">src/Config</directory>
28-
<directory suffix=".php">src/Console</directory>
29-
</exclude>
30-
</whitelist>
31-
</filter>
32-
<logging>
33-
<log type="tap" target="build/report.tap"/>
34-
<log type="junit" target="build/report.junit.xml"/>
35-
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
36-
<log type="coverage-text" target="build/coverage.txt"/>
37-
<log type="coverage-clover" target="build/logs/clover.xml"/>
38-
</logging>
3920
</phpunit>

0 commit comments

Comments
 (0)