Skip to content

Commit

Permalink
Merge pull request #40 from remotelyliving/composer-upgrades-ci-php8
Browse files Browse the repository at this point in the history
Upgrade rector, test php 8, remove composer.lock
  • Loading branch information
Christian Thomas authored Oct 20, 2021
2 parents b8647e6 + 37117dd commit 204efd8
Show file tree
Hide file tree
Showing 22 changed files with 175 additions and 7,462 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/php-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: PHP CI Run

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.1']
name: PHP ${{ matrix.php-versions }} Test on Ubuntu
steps:
- uses: actions/checkout@v2

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run CI suite for ${{ matrix.php-versions }}
run: make build
40 changes: 40 additions & 0 deletions .github/workflows/php-code-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: PHP Code Coverage

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.0']
name: PHP Code Coverage
steps:
- uses: actions/checkout@v2

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run test coverage and send to coveralls
run: make test-coverage-ci
env:
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
XDEBUG_MODE: coverage
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
composer.phar
/vendor/
/coverage/
/.idea/
/.idea/
.DS_Store
.churn.cache
composer.lock
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ unit-tests:
integration-tests:
@vendor/bin/phpunit --bootstrap=./tests/bootstrap.php --testsuite Integration

test-coverage:
test-coverage-ci:
@mkdir -p ./build/logs && ./vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover ./build/logs/clover.xml && php vendor/bin/php-coveralls --root_dir=. -v

test-coverage-html:
@vendor/bin/phpunit --coverage-html ./coverage

style-check:
Expand All @@ -19,6 +22,9 @@ style-check:
dependency-check:
@vendor/bin/composer-require-checker check -vvv ./composer.json

churn-report:
@vendor/bin/churn run

static-analysis:
@vendor/bin/phpstan analyze --level=max ./src && ./vendor/bin/psalm --show-info=false

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Coverage Status](https://coveralls.io/repos/github/remotelyliving/php-dns/badge.svg?branch=master)](https://coveralls.io/github/remotelyliving/php-dns?branch=master)
[![License](https://poser.pugx.org/remotelyliving/php-dns/license)](https://packagist.org/packages/remotelyliving/php-dns)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/remotelyliving/php-dns/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/remotelyliving/php-dns/?branch=master)
[![PHP CI](https://github.com/remotelyliving/php-dns/actions/workflows/php-ci.yml/badge.svg)](https://github.com/remotelyliving/php-dns/actions/workflows/php-ci.yml)

# PHP-DNS: A DNS Abstraction in PHP

Expand Down
56 changes: 56 additions & 0 deletions churn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# The maximum number of files to display in the results table.
# Default: 10
filesToShow: 20

# The minimum score a file need to display in the results table.
# Disabled if null.
# Default: 0.1
minScoreToShow: 0

# The command returns an 1 exit code if the highest score is greater than the threshold.
# Disabled if null.
# Default: null
maxScoreThreshold: 0.9

# The number of parallel jobs to use when processing files.
# Default: 10
parallelJobs: 10

# How far back in the VCS history to count the number of commits to a file
# Can be a human readable date like 'One week ago' or a date like '2017-07-12'
# Default: '10 Years ago'
commitsSince: One year ago

# Files to ignore when processing. The full path to the file relative to the root of your project is required.
# Also supports regular expressions.
# Default: All PHP files in the path provided to churn-php are processed.
#filesToIgnore:

# File extensions to use when processing.
# Default: php
fileExtensions:
- php
- inc

# This list is used only if there is no argument when running churn.
# Default: <empty>
directoriesToScan:
- src
- tests/

# List of user-defined hooks.
# They can be referenced by their full qualified class name if churn has access to the autoloader.
# Otherwise the file path can be used as well.
# See below the section about hooks for more details.
# Default: <empty>
#hooks:

# The version control system used for your project.
# Accepted values: fossil, git, mercurial, subversion, none
# Default: git
vcs: git

# The path of the cache file. It doesn't need to exist before running churn.
# Disabled if null.
# Default: null
cachePath: .churn.cache
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
"symfony/event-dispatcher": "^5.0 || ^4.0 || ^3.0",
"psr/log": "^1.0",
"guzzlehttp/promises": "^1.3",
"spatie/dns": "^1.4"
"spatie/dns": "^1.5"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"maglnet/composer-require-checker": "^1.1",
"maglnet/composer-require-checker": "@stable",
"squizlabs/php_codesniffer": "^3.3",
"psy/psysh": "^0.9.9",
"php-coveralls/php-coveralls": "^2.1",
"symfony/cache": "^4.3",
"vimeo/psalm": "^3.5",
"phpstan/phpstan": "^0.12.49",
"rector/rector": "^0.8.28"
"vimeo/psalm": "^4.10",
"rector/rector": "^0.11.58",
"bmitch/churn-php": "^1.5"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 204efd8

Please sign in to comment.