Skip to content

Commit 38d0cc7

Browse files
committed
CI: Travis to GitHub Actions
1 parent 0983c37 commit 38d0cc7

File tree

2 files changed

+108
-60
lines changed

2 files changed

+108
-60
lines changed
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
phpunit:
11+
name: "PHPUnit (with MySQL)"
12+
runs-on: "ubuntu-latest"
13+
14+
strategy:
15+
matrix:
16+
php-version:
17+
- "7.2"
18+
- "7.3"
19+
- "7.4"
20+
21+
services:
22+
mysql:
23+
image: "mysql:5.7"
24+
env:
25+
MYSQL_ALLOW_EMPTY_PASSWORD: true
26+
MYSQL_ROOT_PASSWORD:
27+
ports:
28+
- "3306:3306"
29+
30+
steps:
31+
- name: "Checkout"
32+
uses: "actions/checkout@v2"
33+
with:
34+
fetch-depth: 2
35+
36+
- name: "Install PHP"
37+
uses: "shivammathur/setup-php@v2"
38+
with:
39+
php-version: "${{ matrix.php-version }}"
40+
extensions: ""
41+
coverage: "pcov"
42+
tools: "cs2pr"
43+
44+
- name: "Cache dependencies installed with composer"
45+
uses: "actions/cache@v1"
46+
with:
47+
path: "~/.composer/cache"
48+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
49+
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
50+
51+
- name: "Install dependencies with composer"
52+
run: "composer install --no-interaction --no-progress --no-suggest"
53+
54+
- name: "Run PHPUnit"
55+
run: "vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=coverage.xml"
56+
57+
- name: "Upload Code Coverage"
58+
if: ${{ matrix.php-version == '7.4' }}
59+
uses: "codecov/codecov-action@v1"
60+
61+
- name: "Run a static analysis with phpstan/phpstan"
62+
run: "composer phpstan -- --error-format=checkstyle | cs2pr"
63+
64+
phpunit-prefer-lowest:
65+
name: "PHPUnit with prefer-lowest"
66+
runs-on: "ubuntu-latest"
67+
68+
strategy:
69+
matrix:
70+
php-version:
71+
- "7.2"
72+
- "7.3"
73+
- "7.4"
74+
75+
services:
76+
mysql:
77+
image: "mysql:8"
78+
env:
79+
MYSQL_ALLOW_EMPTY_PASSWORD: true
80+
MYSQL_ROOT_PASSWORD:
81+
ports:
82+
- "3306:3306"
83+
84+
steps:
85+
- name: "Checkout"
86+
uses: "actions/checkout@v2"
87+
with:
88+
fetch-depth: 2
89+
90+
- name: "Install PHP"
91+
uses: "shivammathur/setup-php@v2"
92+
with:
93+
php-version: "${{ matrix.php-version }}"
94+
extensions: ""
95+
coverage: "pcov"
96+
97+
- name: "Cache dependencies installed with composer"
98+
uses: "actions/cache@v1"
99+
with:
100+
path: "~/.composer/cache"
101+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
102+
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
103+
104+
- name: "Install dependencies with composer"
105+
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"
106+
107+
- name: "Run PHPUnit"
108+
run: "vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=coverage.xml"

.travis.yml

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

0 commit comments

Comments
 (0)