Skip to content

Commit 246c017

Browse files
jrfnlgrogy
authored andcommitted
CI: switch to GitHub Actions - step 2: linting and tests
This commit: * Adds a GH Actions workflow for the PHP lint and unit test CI checks which were previously run on Travis. * Removes the, now redundant, `.travis.yml` configuration. * Updates the `.gitattributes` file. * Updates the "Build Status" badge in the Readme to use the results from the GH `Test` Actions runs.
1 parent 38072a8 commit 246c017

File tree

4 files changed

+54
-49
lines changed

4 files changed

+54
-49
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
/tests export-ignore
33
.gitattributes export-ignore
44
.gitignore export-ignore
5-
.travis.yml export-ignore
65
phpunit.xml.dist export-ignore
76
phpcs.xml.dist export-ignore

.github/workflows/test.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
push:
6+
# Allow manually triggering the workflow.
7+
workflow_dispatch:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
16+
experimental: [false]
17+
18+
include:
19+
- php: '8.1'
20+
experimental: true
21+
22+
name: "Test on PHP ${{ matrix.php }}"
23+
continue-on-error: ${{ matrix.experimental }}
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v2
28+
29+
- name: Setup PHP
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: ${{ matrix.php }}
33+
coverage: none
34+
tools: cs2pr
35+
36+
# Install dependencies and handle caching in one go.
37+
# @link https://github.com/marketplace/actions/install-composer-dependencies
38+
- name: Install Composer dependencies - normal
39+
if: ${{ matrix.experimental == false }}
40+
uses: "ramsey/composer-install@v1"
41+
42+
# For the PHP "nightly", we need to install with ignore platform reqs as not all dependencies allow it.
43+
- name: Install Composer dependencies - with ignore platform
44+
if: ${{ matrix.experimental == true }}
45+
uses: "ramsey/composer-install@v1"
46+
with:
47+
composer-options: --ignore-platform-reqs
48+
49+
- name: Lint
50+
run: composer phplint -- --checkstyle | cs2pr
51+
52+
- name: Run unit tests
53+
run: composer phpunit

.travis.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ PHP Console Color
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)
55
[![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)
6-
[![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)
6+
[![Test](https://github.com/php-parallel-lint/PHP-Console-Color/actions/workflows/test.yml/badge.svg)](https://github.com/php-parallel-lint/PHP-Console-Color/actions/workflows/test.yml)
77
[![License](https://poser.pugx.org/php-parallel-lint/php-console-color/license.svg)](https://packagist.org/packages/php-parallel-lint/php-console-color)
88

99
Simple library for creating colored console ouput.

0 commit comments

Comments
 (0)