Skip to content

Commit 5865b15

Browse files
committed
Introduce Github Actions as a replacement of the Travis CI
1 parent 18806e4 commit 5865b15

File tree

3 files changed

+56
-39
lines changed

3 files changed

+56
-39
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
Build:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php-versions:
15+
- "7.4"
16+
- "8.0"
17+
- "8.1"
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php-versions }}
27+
extensions: ctype, mbstring
28+
tools: cs2pr
29+
30+
- name: Get Composer's cache directory
31+
id: composer-cache-path
32+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
33+
34+
- name: Cache Composer dependencies
35+
uses: actions/cache@v3
36+
id: composer-cache
37+
with:
38+
path: ${{ steps.composer-cache-path.outputs.dir }}
39+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
40+
restore-keys: ${{ runner.os }}-composer-
41+
42+
- name: Install dependencies
43+
run: composer install
44+
45+
- name: PHP-CS-Fixer
46+
if: matrix.php-versions == '8.1'
47+
run: vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
48+
49+
# https://github.com/marketplace/actions/setup-php-action#phpunit
50+
- name: Setup problem matchers for PHPUnit
51+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
52+
53+
- name: PHPUnit
54+
run: vendor/bin/phpunit

.travis.yml

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,9 @@ usages with native `::class` keyword, introduced in PHP 5.5.
265265
[ico-version]: https://img.shields.io/packagist/v/ely/php-code-style.svg?style=flat-square
266266
[ico-license]: https://img.shields.io/badge/license-Apache-green.svg?style=flat-square
267267
[ico-downloads]: https://img.shields.io/packagist/dt/ely/php-code-style.svg?style=flat-square
268-
[ico-build-status]: https://img.shields.io/travis/elyby/php-code-style/master.svg?style=flat-square
268+
[ico-build-status]: https://img.shields.io/github/workflow/status/elyby/php-code-style/CI.svg?style=flat-square
269269

270270
[link-packagist]: https://packagist.org/packages/ely/php-code-style
271271
[link-contributors]: ../../contributors
272272
[link-downloads]: https://packagist.org/packages/ely/php-code-style/stats
273-
[link-build-status]: https://travis-ci.org/elyby/php-code-style
273+
[link-build-status]: https://github.com/elyby/php-code-style/actions

0 commit comments

Comments
 (0)