Skip to content

Commit

Permalink
Moving to github actions (#92)
Browse files Browse the repository at this point in the history
* Moving to github actions

* all packages updated (using dev- copies for now), phpstan/phpunit pass in php 7 and 8

* locking zf config to test, making php 8 use different composer arguments

* some ci fixes

* adding services

* skipping a couple of tests that only seem to fail in github actions

* removing vendor libs from whitelist to test coverage change

* testing codecov action

* setting pcov directory to collect coverage info as expected

* setting all versions now that they are all out
  • Loading branch information
jaydiablo authored Mar 22, 2021
1 parent 50f76be commit d1aca60
Show file tree
Hide file tree
Showing 393 changed files with 3,626 additions and 3,544 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: composer
directory: '/'
schedule:
interval: daily
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
99 changes: 99 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: PHP ${{ matrix.php-versions }} ${{ matrix.composer-args }}
services:
mysql:
image: mysql/mysql-server:5.7
env:
MYSQL_DATABASE: zftest
MYSQL_USER: github
MYSQL_PASSWORD: githubpass
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10
postgres:
image: postgres:10
env:
POSTGRES_DB: zftest
POSTGRES_USER: github
POSTGRES_PASSWORD: githubpass
ports:
- 5432:5432
options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=5
memcached:
image: memcached:latest
ports:
- 11211:11211
# needed because the memcached container does not provide a healthcheck
options: --health-cmd "timeout 5 bash -c 'cat < /dev/null > /dev/udp/127.0.0.1/11211'" --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.2', '7.3', '7.4']
composer-args: ['', '--prefer-lowest']
include:
- operating-system: ubuntu-latest
php-versions: '8.0'
composer-args: '--ignore-platform-reqs --no-scripts'
- operating-system: ubuntu-latest
php-versions: '8.0'
composer-args: '--prefer-lowest --ignore-platform-reqs --no-scripts'
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
coverage: pcov
tools: cs2pr
ini-values: session.save_path="/tmp",memory_limit=1024M
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/[email protected]
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php${{ matrix.php-versions }}-composer-${{ matrix.composer-args }}-${{ hashFiles('**/composer.json') }}
restore-keys: php${{ matrix.php-versions }}-composer-${{ matrix.composer-args }}-
- name: Install Dependencies
run: |
composer update --no-progress --no-suggest --prefer-stable --optimize-autoloader ${{ matrix.composer-args }}
- name: PHPStan
run: composer phpstan
- name: Test
run: cd tests/ && php runalltests.php --coverage
- name: Merge Coverage
run: ./bin/phpcov merge ./build/coverage --clover=./build/coverage/clover.xml
- name: Upload Coverage
uses: codecov/codecov-action@v1
with:
files: ./build/coverage/clover.xml

merge-me:
name: Merge me!
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Merge me!
uses: ridedott/merge-me-action@master
with:
# This must be used as GitHub Actions token does not support
# pushing to protected branches.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_LOGIN: 'dependabot[bot]'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ bin/phpcov
bin/php-parse
bin/phpstan
bin/phpstan.phar
bin/php-cs-fixer
tests/.phpunit.result.cache
.php_cs.cache
18 changes: 18 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->exclude('build')
->exclude('demos')
->exclude('documentation')
->exclude('resources')
->in(__DIR__)
;

$config = new PhpCsFixer\Config();
return $config->setRules([
'@PHPUnit84Migration:risky' => true,
])
->setRiskyAllowed(true)
->setFinder($finder)
;
88 changes: 0 additions & 88 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit d1aca60

Please sign in to comment.