Skip to content

Commit 403e9c9

Browse files
authored
Merge pull request #18 from nextras/github_actions
add GitHub actions
2 parents 514f917 + 0870acd commit 403e9c9

File tree

4 files changed

+81
-37
lines changed

4 files changed

+81
-37
lines changed

.github/workflows/build.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: "Build"
2+
3+
on:
4+
pull_request:
5+
types: [ "opened", "synchronize", "edited", "reopened" ]
6+
push:
7+
branches:
8+
- master
9+
- v*.*
10+
11+
env:
12+
php-tools: "composer:v2, pecl"
13+
14+
jobs:
15+
tests:
16+
name: Tests
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
php-version: [ '7.1', '7.2', '7.3', '7.4', '8.0' ]
22+
deps: [ 'lowest', 'newest' ]
23+
exclude:
24+
- php-version: '7.2'
25+
deps: lowest
26+
- php-version: '7.3'
27+
deps: lowest
28+
- php-version: '7.4'
29+
deps: lowest
30+
- php-version: '8.0'
31+
deps: lowest
32+
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
39+
- name: Setup PHP with pecl extension
40+
uses: shivammathur/setup-php@v2
41+
with:
42+
php-version: ${{ matrix.php-version }}
43+
extensions: mbstring, intl, ctype, json
44+
tools: ${{ env.php-tools }}
45+
46+
- name: Get composer cache directory
47+
id: composercache
48+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
49+
50+
- name: Cache dependencies
51+
uses: actions/cache@v2
52+
with:
53+
path: ${{ steps.composercache.outputs.dir }}
54+
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
55+
restore-keys: ${{ runner.os }}-composer-
56+
57+
- name: Install dependencies
58+
if: matrix.deps == 'newest'
59+
run: composer update --prefer-dist --no-interaction --no-progress --no-suggest
60+
61+
- name: Install lowest dependencies
62+
if: matrix.deps == 'lowest'
63+
run: composer update --prefer-dist --no-interaction --no-progress --no-suggest --prefer-lowest --prefer-stable
64+
65+
- name: Tests
66+
run: ./vendor/bin/tester -C ./tests/test.php
67+
68+
- name: PHPStan
69+
run: ./vendor/bin/phpstan analyze
70+
71+
- name: Print failed expectations
72+
if: ${{ failure() }}
73+
run: |
74+
find tests -name \*.actual -exec echo "--- {}" \; -exec cat {} \; -exec echo \; -exec echo \; && \
75+
find tests -name \*.log -exec echo "--- {}" \; -exec cat {} \; -exec echo \; -exec echo \;

.travis.yml

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

composer.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
{
22
"name": "nextras/orm-phpstan",
3-
"description": "PhpStan extension for Nextras Orm",
3+
"description": "PHPStan extension for Nextras Orm",
44
"type": "phpstan-extension",
55
"license": [
66
"MIT"
77
],
88
"require": {
9-
"php": "~7.1",
10-
"phpstan/phpstan": "^0.12.29"
9+
"php": "~7.1 || ~8.0",
10+
"phpstan/phpstan": "^0.12.29",
11+
"nextras/orm": "~4.0"
1112
},
1213
"require-dev": {
13-
"nette/tester": "~2.0",
14-
"nextras/orm": "~4.0@dev",
15-
"nextras/dbal": "~4.0@dev"
14+
"nette/tester": "^2.3.1"
1615
},
1716
"autoload": {
1817
"psr-4": {

readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
PHPStan for Nextras Orm
22
=======================
33

4-
[![Build Status](https://travis-ci.org/nextras/orm-phpstan.svg?branch=master)](https://travis-ci.org/nextras/orm-phpstan)
5-
4+
[![Build Status](https://github.com/nextras/orm-phpstan/workflows/Build/badge.svg?branch=master)](https://github.com/nextras/orm-phpstan/actions?query=workflow%3ABuild+branch%3Amaster)
65

76
PHPStan extension for Nextras Orm.
87

0 commit comments

Comments
 (0)