Skip to content

Commit

Permalink
Use GitHub Actions instead of Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Dec 13, 2020
1 parent ef925f6 commit b2b2414
Show file tree
Hide file tree
Showing 12 changed files with 191 additions and 61 deletions.
3 changes: 0 additions & 3 deletions .coveralls.yml

This file was deleted.

160 changes: 160 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Build"

on:
pull_request:
push:
branches:
- "master"

jobs:
lint:
name: "Lint"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: "Validate Composer"
run: "composer validate"

- name: "Install dependencies"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Update PHPUnit"
if: matrix.php-version == '7.4' || matrix.php-version == '8.0'
run: "composer require --dev phpunit/phpunit:'^9.5' --update-with-dependencies"


- name: "Lint"
run: "vendor/bin/phing lint"

coding-standards:
name: "Coding Standard"

runs-on: "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "7.4"

- name: "Validate Composer"
run: "composer validate"

- name: "Install dependencies"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Lint"
run: "vendor/bin/phing lint"

- name: "Coding Standard"
run: "vendor/bin/phing cs"

tests:
name: "Tests"
runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix:
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
dependencies:
- "lowest"
- "highest"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress --no-suggest"

- name: "Update PHPUnit"
if: matrix.php-version == '7.4' || matrix.php-version == '8.0'
run: "composer require --dev phpunit/phpunit:'^9.5' --update-with-dependencies"

- name: "Tests"
run: "vendor/bin/phing tests"

static-analysis:
name: "PHPStan"
runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix:
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
dependencies:
- "lowest"
- "highest"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: mbstring
tools: composer:v2

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress --no-suggest"

- name: "Update PHPUnit"
if: matrix.php-version == '7.4' || matrix.php-version == '8.0'
run: "composer require --dev phpunit/phpunit:'^9.5' --update-with-dependencies"

- name: "PHPStan"
run: "vendor/bin/phing phpstan"
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Doctrine extensions for PHPStan

[![Build Status](https://travis-ci.com/phpstan/phpstan-doctrine.svg?branch=master)](https://travis-ci.com/phpstan/phpstan-doctrine)
[![Build](https://github.com/phpstan/phpstan-doctrine/workflows/Build/badge.svg)](https://github.com/phpstan/phpstan-doctrine/actions)
[![Latest Stable Version](https://poser.pugx.org/phpstan/phpstan-doctrine/v/stable)](https://packagist.org/packages/phpstan/phpstan-doctrine)
[![License](https://poser.pugx.org/phpstan/phpstan-doctrine/license)](https://packagist.org/packages/phpstan/phpstan-doctrine)

Expand Down
2 changes: 2 additions & 0 deletions build-cs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/composer.lock
/vendor
7 changes: 7 additions & 0 deletions build-cs/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"require-dev": {
"consistence/coding-standard": "^3.10",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"slevomat/coding-standard": "^6.4"
}
}
15 changes: 13 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@

<target name="cs">
<exec
executable="vendor/bin/phpcs"
executable="composer"
logoutput="true"
passthru="true"
checkreturn="true"
>
<arg value="install"/>
<arg value="--working-dir"/>
<arg path="build-cs"/>
<arg value="--ansi"/>
</exec>
<exec
executable="build-cs/vendor/bin/phpcs"
logoutput="true"
passthru="true"
checkreturn="true"
Expand All @@ -52,7 +63,7 @@

<target name="cs-fix">
<exec
executable="vendor/bin/phpcbf"
executable="build-cs/vendor/bin/phpcbf"
logoutput="true"
passthru="true"
checkreturn="true"
Expand Down
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,22 @@
"doctrine/persistence": "<1.3"
},
"require-dev": {
"consistence/coding-standard": "^3.10",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"doctrine/annotations": "^1.10.0",
"doctrine/collections": "^1.0",
"doctrine/common": "^2.7 || ^3.0",
"doctrine/mongodb-odm": "^1.3 || ^2.1",
"doctrine/orm": "^2.5",
"doctrine/persistence": "^1.1 || ^2.0",
"phing/phing": "^2.16.0",
"phing/phing": "^2.16.3",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/phpstan-phpunit": "^0.12",
"phpstan/phpstan-strict-rules": "^0.12",
"phpunit/phpunit": "^7.0",
"ramsey/uuid-doctrine": "^1.5.0",
"slevomat/coding-standard": "^6.4"
"phpstan/phpstan-phpunit": "^0.12.16",
"phpstan/phpstan-strict-rules": "^0.12.5",
"phpunit/phpunit": "^7.5.20",
"ramsey/uuid-doctrine": "^1.5.0"
},
"config": {
"platform": {
"php": "7.3.24",
"ext-mongo": "1.6.16"
},
"sort-packages": true
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<ruleset name="PHPStan Doctrine">
<rule ref="vendor/consistence/coding-standard/Consistence/ruleset.xml">
<rule ref="build-cs/vendor/consistence/coding-standard/Consistence/ruleset.xml">
<exclude name="Squiz.Functions.GlobalFunction.Found"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/>
Expand Down
3 changes: 0 additions & 3 deletions tests/DoctrineIntegration/ODM/document-manager.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<?php declare(strict_types = 1);

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\ODM\MongoDB\Configuration;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver;

AnnotationRegistry::registerUniqueLoader('class_exists');

$config = new Configuration();
$config->setProxyDir(__DIR__);
$config->setProxyNamespace('PHPstan\Doctrine\OdmProxies');
Expand Down
3 changes: 0 additions & 3 deletions tests/DoctrineIntegration/ORM/entity-manager.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<?php declare(strict_types = 1);

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;

AnnotationRegistry::registerUniqueLoader('class_exists');

$config = new Configuration();
$config->setProxyDir(__DIR__);
$config->setProxyNamespace('PHPstan\Doctrine\OrmProxies');
Expand Down
3 changes: 0 additions & 3 deletions tests/Rules/Doctrine/ORM/entity-manager.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<?php declare(strict_types = 1);

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;

AnnotationRegistry::registerUniqueLoader('class_exists');

$config = new Configuration();
$config->setProxyDir(__DIR__);
$config->setProxyNamespace('PHPstan\Doctrine\OrmProxies');
Expand Down

0 comments on commit b2b2414

Please sign in to comment.