Skip to content

Commit

Permalink
Merge b9a87c5 into 404d5cb
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Apr 15, 2020
2 parents 404d5cb + b9a87c5 commit 3155eaa
Show file tree
Hide file tree
Showing 6 changed files with 206 additions and 183 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
@@ -1,7 +1,7 @@
*.php text eol=lf
/.github export-ignore
.gitattributes export-ignore
.gitignore export-ignore
/.travis.yml export-ignore
/build export-ignore
/build.xml export-ignore
/phpunit.xml.dist export-ignore
Expand Down
202 changes: 202 additions & 0 deletions .github/workflows/build.yml
@@ -0,0 +1,202 @@
# 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"

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

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

- name: "Cache dependencies"
uses: "actions/cache@v1.1.2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"

- name: "Install dependencies"
run: "composer update --prefer-dist --no-interaction --no-progress --no-suggest"

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

coding-standards:
name: "Coding standards"

runs-on: "ubuntu-latest"

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

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

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

- name: "Cache dependencies"
uses: "actions/cache@v1.1.2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"

- name: "Install dependencies"
run: "composer update --prefer-dist --no-interaction --no-progress --no-suggest"

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

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

static-analysis:
name: "Static analysis"

runs-on: "ubuntu-latest"

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

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

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

- name: "Cache dependencies"
uses: "actions/cache@v1.1.2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"

- name: "Install dependencies"
run: "composer update --prefer-dist --no-interaction --no-progress --no-suggest"

- name: "PHPStan"
run: "bin/phing phpstan"

tests:
name: "Tests"

runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
dependencies: ["lowest", "highest"]
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
operating-system: ["ubuntu-latest", "windows-latest"]

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

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

- name: "Cache dependencies"
uses: "actions/cache@v1.1.2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"

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

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

- name: "Tests"
run: "bin/phing tests-without-code-coverage"

code-coverage:
name: "Code coverage"

runs-on: "ubuntu-latest"

env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS }}

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

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

- name: "Install PHP"
uses: "shivammathur/setup-php@1.8.2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
tools: pecl

- name: "Cache dependencies"
uses: "actions/cache@v1.1.2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}-with-coveralls"
restore-keys: "php-${{ matrix.php-version }}-composer-"

- name: "Install dependencies"
run: "composer update --prefer-dist --no-interaction --no-progress --no-suggest"

- name: "Install PHP Coveralls"
run: "composer require php-coveralls/php-coveralls:2.2.0"

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

- name: "Upload to Coveralls"
run: bin/php-coveralls --verbose --config build/coveralls.yml
179 changes: 0 additions & 179 deletions .travis.yml

This file was deleted.

0 comments on commit 3155eaa

Please sign in to comment.