Skip to content

Commit 3a2a552

Browse files
authored
Merge pull request #78 from homersimpsons/feature/github-actions-over-travis
CI: Move to GitHub Actions
2 parents d4940bd + d2bae78 commit 3a2a552

File tree

2 files changed

+177
-51
lines changed

2 files changed

+177
-51
lines changed
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "1.4"
8+
9+
jobs:
10+
coding-quality:
11+
name: "Code Quality"
12+
runs-on: "ubuntu-latest"
13+
14+
strategy:
15+
matrix:
16+
php-version:
17+
- "7.4"
18+
19+
steps:
20+
- name: "Checkout"
21+
uses: "actions/checkout@v2"
22+
23+
- name: "Install PHP"
24+
uses: "shivammathur/setup-php@v2"
25+
with:
26+
coverage: "none"
27+
php-version: "${{ matrix.php-version }}"
28+
tools: "cs2pr"
29+
30+
- name: "Cache dependencies installed with composer"
31+
uses: "actions/cache@v1"
32+
with:
33+
path: "~/.composer/cache"
34+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
35+
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
36+
37+
- name: "Install dependencies with composer"
38+
run: "composer install --no-interaction --no-progress --no-suggest"
39+
40+
- name: "Run a static analysis with phpstan/phpstan"
41+
run: "composer phpstan -- --error-format=checkstyle | cs2pr"
42+
43+
phpunit-prefer-lowest:
44+
name: "PHPUnit with prefer-lowest"
45+
runs-on: "ubuntu-latest"
46+
47+
strategy:
48+
matrix:
49+
php-version:
50+
- "7.2"
51+
52+
services:
53+
mysql:
54+
image: "mysql:8"
55+
env:
56+
MYSQL_ALLOW_EMPTY_PASSWORD: true
57+
MYSQL_ROOT_PASSWORD:
58+
ports:
59+
- "3306:3306"
60+
61+
steps:
62+
- name: "Checkout"
63+
uses: "actions/checkout@v2"
64+
with:
65+
fetch-depth: 2
66+
67+
- name: "Install PHP"
68+
uses: "shivammathur/setup-php@v2"
69+
with:
70+
php-version: "${{ matrix.php-version }}"
71+
extensions: ""
72+
73+
- name: "Cache dependencies installed with composer"
74+
uses: "actions/cache@v1"
75+
with:
76+
path: "~/.composer/cache"
77+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
78+
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
79+
80+
- name: "Install dependencies with composer"
81+
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"
82+
83+
- name: "Run PHPUnit"
84+
run: "vendor/bin/phpunit -c phpunit.mysql8.xml --coverage-clover=coverage.xml"
85+
86+
phpunit-code-coverage:
87+
name: "PHPUnit with Code Coverage"
88+
runs-on: "ubuntu-latest"
89+
90+
strategy:
91+
matrix:
92+
php-version:
93+
- "7.2"
94+
95+
services:
96+
mysql:
97+
image: "mysql:8"
98+
env:
99+
MYSQL_ALLOW_EMPTY_PASSWORD: true
100+
MYSQL_ROOT_PASSWORD:
101+
ports:
102+
- "3306:3306"
103+
104+
steps:
105+
- name: "Checkout"
106+
uses: "actions/checkout@v2"
107+
with:
108+
fetch-depth: 2
109+
110+
- name: "Install PHP"
111+
uses: "shivammathur/setup-php@v2"
112+
with:
113+
php-version: "${{ matrix.php-version }}"
114+
extensions: ""
115+
coverage: "pcov"
116+
117+
- name: "Cache dependencies installed with composer"
118+
uses: "actions/cache@v1"
119+
with:
120+
path: "~/.composer/cache"
121+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
122+
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
123+
124+
- name: "Install dependencies with composer"
125+
run: "composer install --no-interaction --no-progress --no-suggest"
126+
127+
- name: "Run PHPUnit"
128+
run: "vendor/bin/phpunit"
129+
130+
- name: "Run Coveralls"
131+
run: "vendor/bin/coveralls -v"
132+
133+
phpunit:
134+
name: "PHPUnit"
135+
runs-on: "ubuntu-latest"
136+
137+
strategy:
138+
matrix:
139+
php-version:
140+
- "7.1"
141+
- "7.3"
142+
- "7.4"
143+
144+
services:
145+
mysql:
146+
image: "mysql:8"
147+
env:
148+
MYSQL_ALLOW_EMPTY_PASSWORD: true
149+
MYSQL_ROOT_PASSWORD:
150+
ports:
151+
- "3306:3306"
152+
153+
steps:
154+
- name: "Checkout"
155+
uses: "actions/checkout@v2"
156+
with:
157+
fetch-depth: 2
158+
159+
- name: "Install PHP"
160+
uses: "shivammathur/setup-php@v2"
161+
with:
162+
php-version: "${{ matrix.php-version }}"
163+
extensions: ""
164+
coverage: "pcov"
165+
166+
- name: "Cache dependencies installed with composer"
167+
uses: "actions/cache@v1"
168+
with:
169+
path: "~/.composer/cache"
170+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
171+
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
172+
173+
- name: "Install dependencies with composer"
174+
run: "composer install --no-interaction --no-progress --no-suggest"
175+
176+
- name: "Run PHPUnit"
177+
run: "vendor/bin/phpunit"

.travis.yml

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

0 commit comments

Comments
 (0)