Skip to content

Commit baefa98

Browse files
committed
Update build system.
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
1 parent 7148dc2 commit baefa98

File tree

2 files changed

+45
-8
lines changed

2 files changed

+45
-8
lines changed

.github/workflows/tests.yml

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
php: [7.4, 7.3, 7.2]
15+
php: [7.4, 7.3]
16+
laravel: [7.x, 8.x]
1617
os: [ubuntu-latest, windows-latest]
1718

18-
name: PHP${{ matrix.php }} on ${{ matrix.os }}
19+
name: PHP${{ matrix.php }} with Laravel ${{ matrix.laravel }} on ${{ matrix.os }}
1920

2021
steps:
2122
- name: Checkout code
@@ -25,17 +26,53 @@ jobs:
2526
uses: actions/cache@v1
2627
with:
2728
path: ~/.composer/cache/files
28-
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
29+
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
2930

3031
- name: Setup PHP
31-
uses: shivammathur/setup-php@v2
32+
uses: shivammathur/setup-php@v1
3233
with:
3334
php-version: ${{ matrix.php }}
34-
extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlite3, pdo_sqlite, pdo_mysql, bcmath, intl
35+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath
3536
coverage: none
3637

3738
- name: Install dependencies
3839
run: |
39-
composer update --prefer-stable --prefer-dist --no-interaction --no-suggest
40+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
41+
composer update --prefer-dist --no-interaction --no-suggest
42+
- name: Execute tests
43+
run: vendor/bin/phpunit
44+
45+
tests-on-legacy-php:
46+
runs-on: ${{ matrix.os }}
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
php: [7.2]
51+
laravel: [7.x]
52+
os: [ubuntu-latest, windows-latest]
53+
54+
name: PHP${{ matrix.php }} with Laravel ${{ matrix.laravel }} on ${{ matrix.os }}
55+
56+
steps:
57+
- name: Checkout code
58+
uses: actions/checkout@v1
59+
60+
- name: Cache dependencies
61+
uses: actions/cache@v1
62+
with:
63+
path: ~/.composer/cache/files
64+
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
65+
66+
- name: Setup PHP
67+
uses: shivammathur/setup-php@v1
68+
with:
69+
php-version: ${{ matrix.php }}
70+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath
71+
coverage: none
72+
73+
- name: Install dependencies
74+
run: |
75+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
76+
composer update --prefer-dist --no-interaction --no-suggest
4077
- name: Execute tests
4178
run: vendor/bin/phpunit

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ before_script:
2626
- if [[ $setup = 'basic' ]]; then travis_retry composer install --prefer-dist --no-interaction --no-suggest; fi
2727
- if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --no-suggest --prefer-stable; fi
2828
- if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --no-suggest --prefer-lowest --prefer-stable; fi
29-
- if [[ $setup = 'coveralls' ]]; then travis_retry composer require "php-coveralls/php-coveralls=^2.1" --prefer-dist --no-interaction --no-suggest --dev; fi
29+
- if [[ $setup = 'coveralls' ]]; then wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar; chmod +x php-coveralls.phar; fi
3030

3131
script:
3232
- if [[ $coverage = 'yes' ]]; then vendor/bin/phpunit -c phpunit.xml --coverage-clover build/logs/clover.xml; fi
3333
- if [[ $coverage = 'no' ]]; then vendor/bin/phpunit -c phpunit.xml --verbose; fi
3434

3535
after_script:
36-
- if [[ $setup = 'coveralls' ]]; then php vendor/bin/php-coveralls -v; fi
36+
- if [[ $setup = 'coveralls' ]]; then php-coveralls.phar -v; fi
3737

3838
matrix:
3939
include:

0 commit comments

Comments
 (0)