Skip to content

Commit f256543

Browse files
authored
Run tests on Github Actions
1 parent 887ecba commit f256543

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/php.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, develop ]
6+
pull_request:
7+
branches: [ master, develop ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
php-versions: ['5.6', '7.0', '7.0', '7.1', '7.2', '7.3', '7.4']
16+
name: Tests with PHP ${{ matrix.php-versions }}
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php-versions }}
25+
env:
26+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Validate composer
29+
run: composer validate
30+
31+
- name: Cache Composer packages
32+
id: composer-cache
33+
uses: actions/cache@v2
34+
with:
35+
path: vendor
36+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-composer-
39+
- name: Install dependencies
40+
if: steps.composer-cache.outputs.cache-hit != 'true'
41+
run: composer install --prefer-dist --no-interaction
42+
43+
- name: Run unit tests suite
44+
run: vendor/bin/phpunit
45+
46+
- name: Run code style suite
47+
run: vendor/bin/phpcs --standard=Magento2 Magento2/ --extensions=php

0 commit comments

Comments
 (0)