Skip to content

Commit 9d574cc

Browse files
authored
Merge pull request #1 from nipwaayoni/setup-github
Setup GitHub
2 parents f7a72f7 + 922b049 commit 9d574cc

File tree

8 files changed

+807
-26
lines changed

8 files changed

+807
-26
lines changed

.github/workflows/run-lint.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Lint
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
php: [7.4, 7.3]
12+
13+
name: PHP${{ matrix.php }}
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v1
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: ${{ matrix.php }}
23+
tools: composer:v2, phive
24+
25+
- name: Get Composer Cache Directory
26+
id: composer-cache
27+
run: |
28+
echo "::set-output name=dir::$(composer config cache-files-dir)"
29+
30+
- uses: actions/cache@v2
31+
with:
32+
path: ${{ steps.composer-cache.outputs.dir }}
33+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-php${{ matrix.php }}
34+
restore-keys: |
35+
${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
36+
${{ runner.os }}-composer-
37+
38+
- name: Install dependencies
39+
run: |
40+
composer install --prefer-dist --no-interaction --no-suggest
41+
phive --no-progress install --trust-gpg-keys 4AA394086372C20A,CF1A108D0E7AE720,E82B2FB314E9906E
42+
43+
- name: Execute checks
44+
run: |
45+
tools/phpstan analyze src
46+
tools/php-cs-fixer fix --config=.php_cs.dist -v --dry-run --stop-on-violation --using-cache=no

.github/workflows/run-tests.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Unit tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
unit-tests:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
php: [7.4, 7.3]
12+
laravel: [8.*, 7.*]
13+
include:
14+
- laravel: 8.*
15+
testbench: 6.*
16+
- laravel: 7.*
17+
testbench: ^5.2
18+
19+
name: PHP${{ matrix.php }} - L${{ matrix.laravel }}
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v1
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php }}
29+
tools: composer:v2, phive
30+
coverage: xdebug
31+
32+
- name: Get Composer Cache Directory
33+
id: composer-cache
34+
run: |
35+
echo "::set-output name=dir::$(composer config cache-files-dir)"
36+
37+
- uses: actions/cache@v2
38+
with:
39+
path: ${{ steps.composer-cache.outputs.dir }}
40+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.php }}-php${{ matrix.php }}-L${{ matrix.laravel }}
41+
restore-keys: |
42+
${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.php }}-php${{ matrix.php }}
43+
${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.php }}
44+
${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
45+
${{ runner.os }}-composer-
46+
47+
- name: Install dependencies
48+
run: |
49+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
50+
composer update --prefer-dist --no-interaction --no-suggest
51+
phive --no-progress install --trust-gpg-keys 4AA394086372C20A,CF1A108D0E7AE720,E82B2FB314E9906E
52+
53+
- name: Execute unit tests
54+
run:
55+
tools/phpunit tests/Unit
56+
57+
- name: Execute feature tests
58+
run:
59+
tools/phpunit tests/Feature

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/vendor/
2-
/.phive/
32
/tools/
43

54
.idea

.phive/phars.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phive xmlns="https://phar.io/phive">
3+
<phar name="phpunit" version="^9.5.4" installed="9.5.4" location="./tools/phpunit" copy="true"/>
4+
<phar name="phpstan" version="^0.12.83" installed="0.12.83" location="./tools/phpstan" copy="true"/>
5+
<phar name="php-cs-fixer" version="^2.0" installed="2.18.5" location="./tools/php-cs-fixer" copy="true"/>
6+
</phive>

.php_cs.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
22

33
$finder = PhpCsFixer\Finder::create()
4-
->exclude('somedir')
5-
->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php')
64
->in(__DIR__ . DIRECTORY_SEPARATOR . 'src')
75
->in(__DIR__ . DIRECTORY_SEPARATOR . 'tests')
86
;

0 commit comments

Comments
 (0)