Skip to content

Commit 16c103c

Browse files
committed
CI with Github actions
1 parent 64e6ce9 commit 16c103c

File tree

1 file changed

+141
-0
lines changed

1 file changed

+141
-0
lines changed

.github/workflows/tests.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "CI"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "master"
10+
- "development"
11+
12+
jobs:
13+
14+
tests:
15+
16+
name: "Tests"
17+
18+
runs-on: ${{ matrix.operating-system }}
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
php-version:
24+
- "5.6"
25+
- "7.0"
26+
- "7.1"
27+
- "7.2"
28+
- "7.3"
29+
- "7.4"
30+
operating-system: [ubuntu-latest, windows-latest]
31+
32+
steps:
33+
- name: "Checkout"
34+
uses: "actions/checkout@v2"
35+
36+
- name: "Install PHP"
37+
uses: "shivammathur/setup-php@v2"
38+
with:
39+
coverage: "none"
40+
php-version: "${{ matrix.php-version }}"
41+
extensions: "mbstring, gd, bcmath, bz2"
42+
tools: composer:v2
43+
44+
- name: "Install dependencies"
45+
run: "composer install --no-interaction --no-progress --no-suggest"
46+
47+
- name: "Tests"
48+
run: composer test
49+
50+
tests-ignore-reqs:
51+
52+
name: "Tests ignoring reqs"
53+
54+
runs-on: ${{ matrix.operating-system }}
55+
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
php-version:
60+
- "8.0"
61+
operating-system: [ubuntu-latest, windows-latest]
62+
63+
steps:
64+
- name: "Checkout"
65+
uses: "actions/checkout@v2"
66+
67+
- name: "Install PHP"
68+
uses: "shivammathur/setup-php@v2"
69+
with:
70+
coverage: "none"
71+
php-version: "${{ matrix.php-version }}"
72+
extensions: "mbstring, gd, bcmath, bz2"
73+
tools: composer:v2
74+
75+
- name: "Install dependencies"
76+
run: "composer install --no-interaction --no-progress --no-suggest --ignore-platform-reqs"
77+
78+
- name: "Tests"
79+
run: composer test
80+
81+
cs:
82+
83+
name: "Coding standard"
84+
85+
runs-on: ${{ matrix.operating-system }}
86+
87+
strategy:
88+
matrix:
89+
php-version:
90+
- "7.4"
91+
92+
operating-system: [ubuntu-latest]
93+
94+
steps:
95+
- name: "Checkout"
96+
uses: "actions/checkout@v2"
97+
98+
- name: "Install PHP"
99+
uses: "shivammathur/setup-php@v2"
100+
with:
101+
coverage: "none"
102+
php-version: "${{ matrix.php-version }}"
103+
extensions: "mbstring"
104+
tools: composer:v2
105+
106+
- name: "Install dependencies"
107+
run: "composer install --no-interaction --no-progress --no-suggest"
108+
109+
- name: "CS"
110+
run: composer cs
111+
112+
coverage:
113+
114+
name: "Code coverage"
115+
116+
runs-on: ${{ matrix.operating-system }}
117+
118+
strategy:
119+
matrix:
120+
php-version:
121+
- "7.4"
122+
123+
operating-system: [ubuntu-latest]
124+
125+
steps:
126+
- name: "Checkout"
127+
uses: "actions/checkout@v2"
128+
129+
- name: "Install PHP"
130+
uses: "shivammathur/setup-php@v2"
131+
with:
132+
coverage: "xdebug"
133+
php-version: "${{ matrix.php-version }}"
134+
extensions: "mbstring, gd, bcmath, bz2"
135+
tools: composer:v2
136+
137+
- name: "Install dependencies"
138+
run: "composer install --no-interaction --no-progress --no-suggest"
139+
140+
- name: "Code coverage"
141+
run: composer coverage

0 commit comments

Comments
 (0)