Skip to content

Commit bd2d46d

Browse files
committed
Migrate CI to GitHub Actions
1 parent f000392 commit bd2d46d

File tree

2 files changed

+143
-1
lines changed

2 files changed

+143
-1
lines changed

Diff for: .github/workflows/ci.yaml

+142
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: 'CI'
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
coding-standards:
9+
name: 'Coding Standards - PHP ${{ matrix.php-version }}'
10+
11+
runs-on: 'ubuntu-latest'
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php-version:
17+
- '7.4'
18+
19+
steps:
20+
- name: 'Checkout code'
21+
uses: actions/checkout@v2
22+
23+
- name: 'Setup PHP'
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
coverage: 'none'
27+
extensions: 'json,dom'
28+
php-version: '${{ matrix.php-version }}'
29+
tools: php-cs-fixer
30+
31+
- name: 'Display PHP versions'
32+
run: |
33+
php -r 'foreach (get_loaded_extensions() as $extension) echo $extension . " " . phpversion($extension) . PHP_EOL;'
34+
php -i
35+
36+
- name: 'Install Composer dependencies'
37+
uses: ramsey/composer-install@v1
38+
with:
39+
composer-options: '--prefer-dist'
40+
41+
- name: 'Display dependencies versions'
42+
run: composer show
43+
44+
- name: "PHP Coding Standards Fixer"
45+
run: php-cs-fixer fix --dry-run --diff --using-cache=no
46+
47+
- name: "PHP Code Style Sniffer"
48+
if: always()
49+
run: vendor/bin/phpcs --standard=php_cs.xml app src tests
50+
51+
- name: "Psalm"
52+
if: always()
53+
run: vendor/bin/psalm
54+
55+
tests:
56+
name: 'Tests - PHP ${{ matrix.php-version }}'
57+
58+
runs-on: ubuntu-latest
59+
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
include:
64+
- php-version: '7.1.3'
65+
dependency-versions: 'lowest' # Test lowest possible configuration
66+
- php-version: '7.4'
67+
- php-version: '8.0'
68+
69+
steps:
70+
- name: 'Checkout code'
71+
uses: actions/checkout@v2
72+
73+
- name: 'Setup PHP'
74+
uses: shivammathur/setup-php@v2
75+
with:
76+
coverage: 'none'
77+
extensions: 'json,dom'
78+
php-version: '${{ matrix.php-version }}'
79+
tools: php-cs-fixer
80+
81+
- name: 'Display PHP versions'
82+
run: |
83+
php -r 'foreach (get_loaded_extensions() as $extension) echo $extension . " " . phpversion($extension) . PHP_EOL;'
84+
php -i
85+
86+
- name: 'Install Composer dependencies'
87+
uses: ramsey/composer-install@v1
88+
with:
89+
composer-options: '--prefer-dist'
90+
dependency-versions: '${{ matrix.dependency-versions }}'
91+
92+
- name: 'Display dependencies versions'
93+
run: composer show
94+
95+
- name: 'Run tests'
96+
run: vendor/bin/phpunit
97+
98+
code-coverage:
99+
name: 'Code Coverage - PHP ${{ matrix.php-version }}'
100+
101+
runs-on: 'ubuntu-latest'
102+
103+
strategy:
104+
fail-fast: false
105+
matrix:
106+
php-version:
107+
- '7.4'
108+
109+
steps:
110+
- name: 'Checkout code'
111+
uses: actions/checkout@v2
112+
113+
- name: 'Setup PHP'
114+
uses: shivammathur/setup-php@v2
115+
with:
116+
coverage: 'none'
117+
extensions: 'json,dom'
118+
php-version: '${{ matrix.php-version }}'
119+
tools: php-cs-fixer
120+
121+
- name: 'Display PHP versions'
122+
run: |
123+
php -r 'foreach (get_loaded_extensions() as $extension) echo $extension . " " . phpversion($extension) . PHP_EOL;'
124+
php -i
125+
126+
- name: 'Install Composer dependencies'
127+
uses: ramsey/composer-install@v1
128+
with:
129+
composer-options: '--prefer-dist'
130+
131+
- name: 'Display dependencies versions'
132+
run: composer show
133+
134+
- name: 'Run tests with coverage'
135+
run: phpdbg -qrr ./vendor/bin/phpunit --coverage-clover coverage/clover.xml
136+
137+
- name: 'Send Coverage'
138+
continue-on-error: true
139+
timeout-minutes: 1
140+
run: |
141+
wget https://scrutinizer-ci.com/ocular.phar
142+
php ocular.phar code-coverage:upload --format=php-clover coverage/clover.xml

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Implements the concept of **tombstones for dead code detection in PHP**.
55

66
The library provides you with a toolbox to place, track and evaluate tombstones in your code.
77

8-
[![Build Status](https://api.travis-ci.com/scheb/tombstone.svg?branch=1.x)](https://travis-ci.com/scheb/tombstone/branches)
8+
[![Build Status](https://github.com/scheb/tombstone/workflows/CI/badge.svg?branch=1.x)](https://github.com/scheb/tombstone/actions?query=workflow%3ACI+branch%3A1.x)
99
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/scheb/tombstone/badges/quality-score.png?b=1.x)](https://scrutinizer-ci.com/g/scheb/tombstone/?branch=1.x)
1010
[![Code Coverage](https://scrutinizer-ci.com/g/scheb/tombstone/badges/coverage.png?b=1.x)](https://scrutinizer-ci.com/g/scheb/tombstone/?branch=1.x)
1111
[![Latest Stable Version](https://poser.pugx.org/scheb/tombstone/v/stable.svg)](https://packagist.org/packages/scheb/tombstone)

0 commit comments

Comments
 (0)