Skip to content

Commit

Permalink
add Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Feb 11, 2020
1 parent c784469 commit a2cff5c
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 44 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/coding_standard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Coding Standard

on:
pull_request: null
push:
branches:
- master

jobs:
ecs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
# see https://github.com/shivammathur/setup-php
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none

- run: composer install --no-progress
- run: composer check-cs
22 changes: 22 additions & 0 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Linter

on:
pull_request: null
push:
branches:
- master

jobs:
linter:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none

- run: composer install --no-progress
- run: vendor/bin/parallel-lint src tests -e php,phpt
21 changes: 21 additions & 0 deletions .github/workflows/phpstan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: PHPStan

on:
pull_request: null
push:
branches:
- master

jobs:
phpstan:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none

- run: composer install --no-progress
- run: composer phpstan
21 changes: 21 additions & 0 deletions .github/workflows/rector_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Rector CI

on:
pull_request: null
push:
branches:
- master

jobs:
rector:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none

- run: composer install --no-progress
- run: composer rector
49 changes: 5 additions & 44 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dist: xenial # see https://travis-ci.community/t/postgresql-fails-to-start-unrecognized-operating-system/4558

language: php

install:
Expand Down Expand Up @@ -28,6 +29,8 @@ jobs:
- DB_PASSWD=root
- DB_MEMORY=false
php: '7.2'
install:
- composer update --prefer-lowest
before_script:
- psql -c 'CREATE DATABASE orm_behaviors_test' -U postgres
# see https://www.guru99.com/postgresql-create-alter-add-user.html step 5)
Expand All @@ -45,12 +48,6 @@ jobs:
<<: *POSTGRES_JOB
php: '7.4'

-
<<: *POSTGRES_JOB
php: '7.2'
install:
- composer update --prefer-lowest

# MySQL
- &MYSQL_JOB
stage: test
Expand All @@ -66,6 +63,8 @@ jobs:
- DB_PASSWD=""
- DB_MEMORY=false
php: '7.2'
install:
- composer update --prefer-lowest
before_script:
- mysql -e 'create database IF NOT EXISTS orm_behaviors_test' -uroot
script:
Expand All @@ -79,44 +78,6 @@ jobs:
<<: *MYSQL_JOB
php: '7.4'

-
<<: *MYSQL_JOB
php: '7.2'
install:
- composer update --prefer-lowest

-
stage: test
name: "Lint PHP"
php: '7.2'
script:
- vendor/bin/parallel-lint src tests -e php,phpt

-
stage: test
name: "Coding Standards"
php: '7.2'
script:
- composer check-cs


-
stage: test
name: "Static Analysis"
php: '7.2'
script:
- composer phpstan

-
stage: test
name: "Rector"
php: '7.2'
script:
- composer rector

allow_failures:
- name: "Rector"

cache:
directories:
- $HOME/.composer/cache

0 comments on commit a2cff5c

Please sign in to comment.