Skip to content
This repository has been archived by the owner on Nov 26, 2019. It is now read-only.

Enhancement: Synchronize project tooling configuration with localheinz/php-library-template #207

Merged
merged 1 commit into from
Sep 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ trim_trailing_whitespace = true
[*.json]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

Expand Down
5 changes: 1 addition & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
/.dependabot/ export-ignore
/.github/ export-ignore
/.travis/ export-ignore
/test export-ignore
/test/ export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs export-ignore
/.travis.yml export-ignore
/Makefile export-ignore
/phpunit.xml export-ignore
24 changes: 12 additions & 12 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# CONTRIBUTING

We're using [Travis CI](https://travis-ci.com) as a continuous integration system.
We are using [GitHub Actions](https://github.com/features/actions) as a continuous integration system.

For details, see [`.travis.yml`](../.travis.yml).
For details, see [`workflows/continuous-integration.yml`](workflows/continuous-integration.yml).

## Tests
## Coding Standards

We're using [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) to drive the development.
We are using [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to enforce coding standards.

Run

```
$ make test
$ make cs
```

to run all the tests.
to automatically fix coding standard violations.

## Coding Standards
## Extra lazy?

We are using [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to enforce coding standards.
## Tests

We are using [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) to drive the development.

Run

```
$ make cs
$ make test
```

to automatically fix coding standard violations.

## Extra lazy?
to run all the tests.

Run

Expand Down
17 changes: 13 additions & 4 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@ branches:
required_approving_review_count: 1
required_status_checks:
contexts:
- "codecov/patch"
- "codecov/project"
- "Travis CI - Branch"
- "Travis CI - Pull Request"
- "Coding Standards"
- "Tests (php7.1, lowest)"
- "Tests (php7.1, locked)"
- "Tests (php7.1, highest)"
- "Tests (php7.2, lowest)"
- "Tests (php7.2, locked)"
- "Tests (php7.2, highest)"
- "Tests (php7.3, lowest)"
- "Tests (php7.3, locked)"
- "Tests (php7.3, highest)"
- "Code Coverage"
- "codecov/patch"
- "codecov/project"
strict: false
restrictions: null

Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

on:
- pull_request
- push

name: "Continuous Integration"

jobs:
coding-standards:
name: "Coding Standards"

runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: actions/checkout@master

- name: "Validate composer.json and composer.lock"
run: php7.1 $(which composer) validate --strict

- name: "Install locked dependencies with composer"
run: php7.1 $(which composer) install

- name: "Run localheinz/composer-normalize"
run: php7.1 $(which composer) normalize --dry-run

- name: "Run friendsofphp/php-cs-fixer"
run: php7.1 vendor/bin/php-cs-fixer fix --diff --dry-run --using-cache=no --verbose

tests:
name: "Tests"

runs-on: ubuntu-latest

strategy:
matrix:
php-binary:
- php7.1
- php7.2
- php7.3

dependencies:
- lowest
- locked
- highest

steps:
- name: "Checkout"
uses: actions/checkout@master

- name: "Install lowest dependencies with composer"
if: matrix.dependencies == 'lowest'
run: ${{ matrix.php-binary }} $(which composer) update --prefer-lowest

- name: "Install locked dependencies with composer"
if: matrix.dependencies == 'locked'
run: ${{ matrix.php-binary }} $(which composer) install

- name: "Install highest dependencies with composer"
if: matrix.dependencies == 'highest'
run: ${{ matrix.php-binary }} $(which composer) update

- name: "Run unit tests with phpunit/phpunit"
run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=test/Unit/phpunit.xml

code-coverage:
name: "Code Coverage"

runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: actions/checkout@master

- name: "Install locked dependencies with composer"
run: php7.3 $(which composer) install

- name: "Dump Xdebug filter with phpunit/phpunit"
run: php7.3 vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --dump-xdebug-filter=.build/phpunit/xdebug-filter.php

- name: "Collect code coverage with Xdebug and phpunit/phpunit"
run: php7.3 vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-clover=build/logs/clover.xml --prepend=.build/phpunit/xdebug-filter.php

- name: "Download code coverage uploader for Codecov.io"
run: curl -s https://codecov.io/bash -o codecov

- name: "Send code coverage report to Codecov.io"
run: bash codecov -t ${{ secrets.CODECOV_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# https://github.com/actions/stale

name: "Close stale issues and pull requests"
on:
schedule:
- cron: "0 * * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 60
days-before-close: 5
stale-issue-label: 'stale'
stale-issue-message: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
stale-pr-message: >
This PR has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
stale-pr-label: 'stale'
2 changes: 1 addition & 1 deletion .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ $config->getFinder()
->in(__DIR__)
->exclude([
'.build',
'.dependabot',
'.github',
'.travis',
])
->name('.php_cs');

Expand Down
114 changes: 0 additions & 114 deletions .travis.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .travis/xdebug.sh

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

For a full diff see [`1.23.0...master`](https://github.com/localheinz/php-cs-fixer-config/compare/1.23.0...master).
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017-2018 Andreas Möller
Copyright (c) 2017 Andreas Möller

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
Expand Down
Loading