Skip to content

Commit

Permalink
Use Github actions for phpunit, remove Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Oct 25, 2020
1 parent 2e94146 commit 0be0b31
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 44 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "Continuous Integration"

on:
pull_request:
branches:
- "*.x"
- "master"
push:
branches:
- "*.x"
- "master"

jobs:
phpunit:
name: "PHPUnit"
runs-on: "ubuntu-20.04"

strategy:
matrix:
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
deps:
- "normal"
include:
- deps: "low"
php-version: "7.2"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "pcov"
ini-values: "zend.assertions=1"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Update dependencies with composer"
run: "composer update --no-interaction --no-progress --no-suggest"
if: "${{ matrix.deps == 'normal' }}"

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

- name: "Run PHPUnit"
run: "vendor/bin/phpunit"
45 changes: 45 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Static Analysis"

on:
pull_request:
branches:
- "*.x"
- "master"
push:
branches:
- "*.x"
- "master"

jobs:
static-analysis-phpstan:
name: "Static Analysis with PHPStan"
runs-on: "ubuntu-20.04"

strategy:
matrix:
php-version:
- "7.4"

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

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

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

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

- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan analyse -l 3 -c phpstan.neon --error-format=checkstyle lib/ tests/ | cs2pr"
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

0 comments on commit 0be0b31

Please sign in to comment.