Skip to content

Commit 0d72f3b

Browse files
authored
MQE-2255: Migrate MFTF builds out of Travis
1 parent 651db4f commit 0d72f3b

File tree

1 file changed

+150
-0
lines changed

1 file changed

+150
-0
lines changed

.github/workflows/main.yml

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# Copyright © Magento, Inc. All rights reserved.
2+
# See COPYING.txt for license details.
3+
4+
name: CI
5+
6+
on: [pull_request]
7+
8+
jobs:
9+
unit-tests:
10+
name: Unit Tests
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
php-versions: ['7.3', '7.4']
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@master
21+
with:
22+
php-version: ${{ matrix.php-versions }}
23+
extensions: bcmath, ctype, curl, dom, gd, hash, iconv, intl, mbstring, openssl, pdo_mysql, simplexml, soap, xsl, zip
24+
25+
- name: Cache Composer packages
26+
id: composer-cache
27+
uses: actions/cache@v2
28+
with:
29+
path: vendor
30+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
31+
restore-keys: |
32+
${{ runner.os }}-php-
33+
34+
- name: Install dependencies
35+
if: steps.composer-cache.outputs.cache-hit != 'true'
36+
run: composer install --prefer-dist --no-progress --no-suggest
37+
38+
- name: Run tests
39+
run: vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite unit --coverage-clover clover.xml
40+
41+
- name: Monitor coverage
42+
if: github.event_name == 'pull_request'
43+
uses: slavcodev/[email protected]
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
clover_file: "clover.xml"
47+
threshold_alert: 10
48+
threshold_warning: 20
49+
50+
verification-tests:
51+
name: Verification Tests
52+
runs-on: ubuntu-latest
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
php-versions: ['7.3', '7.4']
57+
steps:
58+
- uses: actions/checkout@v2
59+
60+
- name: Setup PHP
61+
uses: shivammathur/setup-php@master
62+
with:
63+
php-version: ${{ matrix.php-versions }}
64+
extensions: bcmath, ctype, curl, dom, gd, hash, iconv, intl, mbstring, openssl, pdo_mysql, simplexml, soap, xsl, zip
65+
66+
- name: Cache Composer packages
67+
id: composer-cache
68+
uses: actions/cache@v2
69+
with:
70+
path: vendor
71+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
72+
restore-keys: |
73+
${{ runner.os }}-php-
74+
75+
- name: Install dependencies
76+
if: steps.composer-cache.outputs.cache-hit != 'true'
77+
run: composer install --prefer-dist --no-progress --no-suggest
78+
79+
- name: Run tests
80+
run: vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite verification
81+
82+
static-tests:
83+
name: Static Tests
84+
runs-on: ubuntu-latest
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
php-versions: ['7.3', '7.4']
89+
steps:
90+
- uses: actions/checkout@v2
91+
92+
- name: Setup PHP
93+
uses: shivammathur/setup-php@master
94+
with:
95+
php-version: ${{ matrix.php-versions }}
96+
extensions: bcmath, ctype, curl, dom, gd, hash, iconv, intl, mbstring, openssl, pdo_mysql, simplexml, soap, xsl, zip
97+
98+
- name: Cache Composer packages
99+
id: composer-cache
100+
uses: actions/cache@v2
101+
with:
102+
path: vendor
103+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
104+
restore-keys: |
105+
${{ runner.os }}-php-
106+
107+
- name: Install dependencies
108+
if: steps.composer-cache.outputs.cache-hit != 'true'
109+
run: composer install --prefer-dist --no-progress --no-suggest
110+
111+
- name: Run tests
112+
run: bin/static-checks
113+
114+
functional-tests:
115+
name: Functional Tests
116+
runs-on: ubuntu-latest
117+
strategy:
118+
fail-fast: false
119+
matrix:
120+
php-versions: ['7.3', '7.4']
121+
122+
services:
123+
chrome:
124+
image: selenium/standalone-chrome:3.141.59-zirconium
125+
ports:
126+
- 4444:4444
127+
steps:
128+
- uses: actions/checkout@v2
129+
130+
- name: Setup PHP
131+
uses: shivammathur/setup-php@master
132+
with:
133+
php-version: ${{ matrix.php-versions }}
134+
extensions: bcmath, ctype, curl, dom, gd, hash, iconv, intl, mbstring, openssl, pdo_mysql, simplexml, soap, xsl, zip
135+
136+
- name: Cache Composer packages
137+
id: composer-cache
138+
uses: actions/cache@v2
139+
with:
140+
path: vendor
141+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
142+
restore-keys: |
143+
${{ runner.os }}-php-
144+
145+
- name: Install dependencies
146+
if: steps.composer-cache.outputs.cache-hit != 'true'
147+
run: composer install --prefer-dist --no-progress --no-suggest
148+
149+
- name: Run tests
150+
run: bin/functional

0 commit comments

Comments
 (0)