Skip to content

Commit 38072a8

Browse files
jrfnlgrogy
authored andcommitted
CI: switch to GitHub Actions - step 1: code style sniffing
This commit: * Adds a GH Actions workflow for the code style CI check which was previously run on Travis. * Removes that part of the `.travis.yml` configuration. * Updates the `.gitattributes` file. * Adds a separate badge for the CS workflow to the README.
1 parent ea6bdaa commit 38072a8

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.github export-ignore
12
/tests export-ignore
23
.gitattributes export-ignore
34
.gitignore export-ignore

.github/workflows/cs.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CS
2+
3+
on:
4+
push:
5+
pull_request:
6+
# Allow manually triggering the workflow.
7+
workflow_dispatch:
8+
9+
jobs:
10+
checkcs:
11+
name: 'Check code style'
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Install PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: '7.4'
22+
coverage: none
23+
tools: cs2pr
24+
25+
# Install dependencies and handle caching in one go.
26+
# @link https://github.com/marketplace/actions/install-composer-dependencies
27+
- name: Install Composer dependencies
28+
uses: "ramsey/composer-install@v1"
29+
30+
- name: Check PHP code style
31+
continue-on-error: true
32+
run: vendor/bin/phpcs --report-full --report-checkstyle=./checkstyle.xml
33+
34+
- name: Show PHPCS results in PR
35+
run: cs2pr ./checkstyle.xml --graceful-warnings

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,4 @@ before_script:
4444
4545
script:
4646
- ant phplint
47-
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.4" ]]; then ant phpcs;fi
4847
- ant phpunit

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ PHP Console Color
22
=================
33

44
[![Downloads this Month](https://img.shields.io/packagist/dm/php-parallel-lint/php-console-color.svg)](https://packagist.org/packages/php-parallel-lint/php-console-color)
5+
[![CS](https://github.com/php-parallel-lint/PHP-Console-Color/actions/workflows/cs.yml/badge.svg)](https://github.com/php-parallel-lint/PHP-Console-Color/actions/workflows/cs.yml)
56
[![Build Status](https://travis-ci.org/php-parallel-lint/PHP-Console-Color.svg?branch=master)](https://travis-ci.org/php-parallel-lint/PHP-Console-Color)
67
[![License](https://poser.pugx.org/php-parallel-lint/php-console-color/license.svg)](https://packagist.org/packages/php-parallel-lint/php-console-color)
78

0 commit comments

Comments
 (0)