Skip to content

Commit

Permalink
Implement Github actions over TravisCI (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
BowlOfSoup authored Mar 2, 2024
1 parent 5ad2a9f commit f461860
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 37 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [7.2, 7.4, 8.2]
include:
- php-version: 8.2
env:
SYMFONY_VERSION: ~5.4
fail-fast: true

steps:
- uses: actions/checkout@v3

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:1.10.22

- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: $HOME/.composer/cache
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: |
if [ "${{ matrix.env.SYMFONY_VERSION }}" != "" ]; then composer require "symfony/symfony:${{ matrix.env.SYMFONY_VERSION }}" --no-update; fi;
COMPOSER_MEMORY_LIMIT=-1 composer install
- name: Setup Codecov
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
- name: Run Rector
run: vendor/bin/rector process --dry-run --no-progress-bar --ansi

- name: Run PHPStan
run: vendor/bin/phpstan analyze --no-progress --ansi

- name: Run PHPUnit tests
run: XDEBUG_MODE=coverage php vendor/bin/phpunit

- name: Upload coverage to Codecov
run: ./codecov
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"doctrine/collections": "1.*",
"phpunit/phpunit": "^8.0",
"friendsofphp/php-cs-fixer": "^3.0",
"rector/rector": "^0.18.6",
"rector/rector": "^1.0.0",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-symfony": "^1.3"
},
Expand Down
2 changes: 2 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

return static function (RectorConfig $rectorConfig): void
{
$rectorConfig->disableParallel();

$rectorConfig->paths([
__DIR__,
]);
Expand Down

0 comments on commit f461860

Please sign in to comment.