Skip to content

Commit 6492a8f

Browse files
committed
Migrate to GH actions
1 parent 9ad6ce7 commit 6492a8f

6 files changed

Lines changed: 84 additions & 72 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
env:
8+
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
9+
SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT: "1"
10+
11+
jobs:
12+
tests:
13+
name: "CI"
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
php-version:
20+
- "5.3"
21+
- "5.4"
22+
- "5.5"
23+
- "5.6"
24+
- "7.0"
25+
- "7.1"
26+
- "7.2"
27+
- "7.3"
28+
- "7.4"
29+
- "8.0"
30+
- "8.1"
31+
32+
steps:
33+
- name: "Checkout"
34+
uses: "actions/checkout@v2"
35+
36+
- name: "Install PHP"
37+
uses: "shivammathur/setup-php@v2"
38+
with:
39+
coverage: "none"
40+
php-version: "${{ matrix.php-version }}"
41+
42+
- name: Get composer cache directory
43+
id: composercache
44+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
45+
46+
- name: Cache dependencies
47+
uses: actions/cache@v2
48+
with:
49+
path: ${{ steps.composercache.outputs.dir }}
50+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
51+
restore-keys: ${{ runner.os }}-composer-
52+
53+
- name: "Install latest dependencies"
54+
run: |
55+
# Remove PHPStan as it requires a newer PHP
56+
composer remove phpstan/phpstan --dev --no-update
57+
composer update ${{ env.COMPOSER_FLAGS }}
58+
59+
- name: "Run tests"
60+
run: "composer test"

.github/workflows/phpstan.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name: "PHPStan"
22

33
on:
4-
push:
5-
pull_request:
4+
- push
5+
- pull_request
66

77
env:
8-
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist"
8+
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
9+
SYMFONY_PHPUNIT_VERSION: ""
910

1011
jobs:
1112
tests:
@@ -16,7 +17,7 @@ jobs:
1617
strategy:
1718
matrix:
1819
php-version:
19-
- "7.4"
20+
- "8.0"
2021

2122
steps:
2223
- name: "Checkout"
@@ -26,25 +27,21 @@ jobs:
2627
uses: "shivammathur/setup-php@v2"
2728
with:
2829
coverage: "none"
29-
ini-values: "memory_limit=-1"
3030
php-version: "${{ matrix.php-version }}"
3131

32+
- name: Get composer cache directory
33+
id: composercache
34+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
3235

33-
- name: "Determine composer cache directory"
34-
id: "determine-composer-cache-directory"
35-
run: "echo \"::set-output name=directory::$(php bin/composer config cache-dir)\""
36-
37-
- name: "Cache dependencies installed with composer"
38-
uses: "actions/cache@v1"
36+
- name: Cache dependencies
37+
uses: actions/cache@v2
3938
with:
40-
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
41-
key: "php-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}"
42-
restore-keys: "php-${{ matrix.php-version }}"
39+
path: ${{ steps.composercache.outputs.dir }}
40+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
41+
restore-keys: ${{ runner.os }}-composer-
4342

44-
- name: "Install highest dependencies from composer.json using composer binary provided by system"
43+
- name: "Install latest dependencies"
4544
run: "composer update ${{ env.COMPOSER_FLAGS }}"
4645

4746
- name: Run PHPStan
48-
run: |
49-
composer require --dev phpstan/phpstan:^0.12.26
50-
vendor/bin/phpstan analyse --configuration=phpstan-config.neon
47+
run: composer phpstan

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
vendor
22
composer.lock
3-
composer.phar
3+
composer.phar
4+
.phpunit.result.cache

.travis.yml

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

composer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@
1515
"php": "^5.3 || ^7.0 || ^8.0"
1616
},
1717
"require-dev": {
18-
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
18+
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13",
19+
"phpstan/phpstan": "^0.12.59"
1920
},
2021
"autoload": {
2122
"psr-4": { "Seld\\JsonLint\\": "src/Seld/JsonLint/" }
2223
},
23-
"bin": ["bin/jsonlint"]
24+
"bin": ["bin/jsonlint"],
25+
"scripts": {
26+
"test": "vendor/bin/phpunit",
27+
"phpstan": "vendor/bin/phpstan analyse"
28+
}
2429
}
File renamed without changes.

0 commit comments

Comments
 (0)