Skip to content

Commit dc67ed4

Browse files
authored
ci: replace travis to github actions
Replace Travis with GitHub Actions for continuous integration.
2 parents 21f477f + fd6d6be commit dc67ed4

File tree

2 files changed

+83
-49
lines changed

2 files changed

+83
-49
lines changed

.github/workflows/ci.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main", "develop" ]
6+
pull_request:
7+
branches: [ "main", "develop" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
14+
cs:
15+
runs-on: 'ubuntu-latest'
16+
name: 'Coding style'
17+
steps:
18+
- name: 'Checkout'
19+
uses: 'actions/checkout@v2'
20+
21+
- name: 'Setup PHP'
22+
uses: 'shivammathur/setup-php@v2'
23+
with:
24+
php-version: '7.4'
25+
coverage: 'none'
26+
tools: 'composer:v2, composer-normalize'
27+
28+
- name: 'Install dependencies'
29+
run: |
30+
composer install --no-interaction --no-progress --ansi
31+
32+
- name: 'Check PHP code'
33+
run: |
34+
composer phpcs
35+
composer phpmd
36+
37+
- name: 'Check composer.json'
38+
run: 'composer-normalize --diff --dry-run --no-update-lock'
39+
if: 'always()'
40+
41+
phpunit:
42+
43+
runs-on: ${{ matrix.system }}
44+
45+
name: 'PHPUnit (PHP ${{ matrix.php }} - ${{ matrix.system }})'
46+
strategy:
47+
matrix:
48+
system: ['ubuntu-latest']
49+
php:
50+
- '5.6'
51+
- '7.0'
52+
- '7.1'
53+
- '7.2'
54+
- '7.3'
55+
- '7.4'
56+
57+
steps:
58+
- name: Checkout Code
59+
uses: actions/checkout@v2
60+
61+
- name: 'Setup PHP'
62+
uses: 'shivammathur/setup-php@v2'
63+
with:
64+
php-version: '${{ matrix.php }}'
65+
coverage: 'none'
66+
tools: 'composer:v2'
67+
68+
- name: 'Install dependencies'
69+
run: |
70+
composer install --no-interaction --no-progress --ansi
71+
72+
- name: 'Run unit tests'
73+
run: |
74+
composer phpunit
75+
76+
coverage:
77+
runs-on: 'ubuntu-latest'
78+
name: 'Code Coverage'
79+
steps:
80+
- name: Send code coverage report to Codecov.io
81+
uses: codecov/codecov-action@v2
82+
with:
83+
token: ${{ secrets.CODECOV_TOKEN }}

.travis.yml

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

0 commit comments

Comments
 (0)