Skip to content

Commit 088ade8

Browse files
committed
chore(ci): migrate CI from Travis to GitHub Actions
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
1 parent b06f614 commit 088ade8

File tree

6 files changed

+529
-611
lines changed

6 files changed

+529
-611
lines changed

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: https://www.paypal.me/jfcherng/5usd

.github/workflows/php.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
- "*/*"
8+
pull_request:
9+
branches:
10+
- "*"
11+
- "*/*"
12+
13+
jobs:
14+
job_analysis:
15+
name: Analysis (PHP ${{ matrix.php-versions }})
16+
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest]
20+
php-versions: ["7.1", "7.2", "7.3", "7.4"]
21+
22+
runs-on: ${{ matrix.os }}
23+
steps:
24+
- uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php-versions }}
27+
tools: pecl
28+
extensions: ast, mbstring, curl, json, intl, gd, xml, zip, bz2, opcache, sockets
29+
30+
- name: Show PHP information
31+
run: |
32+
php -v
33+
php -m
34+
35+
- uses: actions/checkout@v2
36+
37+
- name: Get composer cache directory
38+
id: composer-cache
39+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
40+
41+
- name: Cache dependencies
42+
uses: actions/cache@v2
43+
with:
44+
path: ${{ steps.composer-cache.outputs.dir }}
45+
key: ${{ matrix.os }}-${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.lock') }}
46+
restore-keys: ${{ matrix.os }}-${{ matrix.php-versions }}-composer-
47+
48+
- name: Install dependencies
49+
run: |
50+
composer global require hirak/prestissimo --prefer-dist --no-progress
51+
composer config platform.php $(php -r 'preg_match("#^\d+\.\d+\.\d+#", PHP_VERSION, $v); echo $v[0];')
52+
composer update --prefer-dist --no-progress --no-suggest
53+
54+
- name: Run composer script "analyze"
55+
run: composer run-script analyze
56+
57+
job_tests:
58+
name: Tests (PHP ${{ matrix.php-versions }})
59+
60+
strategy:
61+
matrix:
62+
os: [ubuntu-latest]
63+
php-versions: ["7.1", "7.2", "7.3", "7.4"]
64+
65+
runs-on: ${{ matrix.os }}
66+
steps:
67+
- uses: shivammathur/setup-php@v2
68+
with:
69+
php-version: ${{ matrix.php-versions }}
70+
tools: pecl
71+
extensions: ast, mbstring, curl, json, intl, gd, xml, zip, bz2, opcache, sockets
72+
73+
- name: Show PHP information
74+
run: |
75+
php -v
76+
php -m
77+
78+
- uses: actions/checkout@v2
79+
80+
- name: Get composer cache directory
81+
id: composer-cache
82+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
83+
84+
- name: Cache dependencies
85+
uses: actions/cache@v2
86+
with:
87+
path: ${{ steps.composer-cache.outputs.dir }}
88+
key: ${{ matrix.os }}-${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.lock') }}
89+
restore-keys: ${{ matrix.os }}-${{ matrix.php-versions }}-composer-
90+
91+
- name: Install dependencies
92+
run: |
93+
composer global require hirak/prestissimo --prefer-dist --no-progress
94+
composer config platform.php $(php -r 'preg_match("#^\d+\.\d+\.\d+#", PHP_VERSION, $v); echo $v[0];')
95+
composer update --prefer-dist --no-progress --no-suggest
96+
97+
- name: Run composer script "test"
98+
run: composer run-script test

.travis.yml

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# php-color-output
22

3-
[![Travis (.org) branch](https://img.shields.io/travis/jfcherng/php-color-output/master?style=flat-square)](https://travis-ci.org/jfcherng/php-color-output)
3+
[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/jfcherng/php-color-output/Main/master?style=flat-square)](https://github.com/jfcherng/php-color-output/actions)
44
[![Packagist](https://img.shields.io/packagist/dt/jfcherng/php-color-output?style=flat-square)](https://packagist.org/packages/jfcherng/php-color-output)
55
[![Packagist Version](https://img.shields.io/packagist/v/jfcherng/php-color-output?style=flat-square)](https://packagist.org/packages/jfcherng/php-color-output)
66
[![Project license](https://img.shields.io/github/license/jfcherng/php-color-output?style=flat-square)](https://github.com/jfcherng/php-color-output/blob/master/LICENSE)
77
[![GitHub stars](https://img.shields.io/github/stars/jfcherng/php-color-output?style=flat-square&logo=github)](https://github.com/jfcherng/php-color-output/stargazers)
88
[![Donate to this project using Paypal](https://img.shields.io/badge/paypal-donate-blue.svg?style=flat-square&logo=paypal)](https://www.paypal.me/jfcherng/5usd)
99

10-
![demo.gif](https://i.imgur.com/xMhYHjV.gif)
10+
![demo.gif](https://github.com/jfcherng/php-color-output/blob/gh-pages/images/demo.gif?raw=true)
1111

1212
The above screenshot is the output of `demo.php`. See the [Example](#example) section.
1313

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@
3535
},
3636
"require-dev": {
3737
"friendsofphp/php-cs-fixer": "^2.15",
38-
"phan/phan": "^2.2",
39-
"phpunit/phpunit": "^7.2 || ^8.2 || ^9",
38+
"phan/phan": "^2 || ^3",
39+
"phpunit/phpunit": ">=7 <10",
4040
"squizlabs/php_codesniffer": "^3.5"
4141
},
4242
"config": {
43+
"platform": {
44+
"php": "7.1.3"
45+
},
4346
"sort-packages": true
4447
},
4548
"scripts": {

0 commit comments

Comments
 (0)