Skip to content

Commit 5641507

Browse files
authored
Merge pull request #8 from magento-commerce/imported-magento-magento-coding-standard-207
[Imported] Run tests on Github Actions
2 parents 887ecba + 60fed78 commit 5641507

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/php.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
fail-fast: false
15+
matrix:
16+
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
17+
name: Tests with PHP ${{ matrix.php-versions }}
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-versions }}
26+
env:
27+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Validate composer
30+
run: composer validate
31+
32+
- name: Cache Composer packages
33+
id: composer-cache
34+
uses: actions/cache@v2
35+
with:
36+
path: vendor
37+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
38+
restore-keys: |
39+
${{ runner.os }}-composer-
40+
- name: Install dependencies
41+
if: steps.composer-cache.outputs.cache-hit != 'true'
42+
run: composer install --prefer-dist --no-interaction
43+
44+
- name: Run unit tests suite
45+
run: vendor/bin/phpunit
46+
47+
- name: Run code style suite
48+
run: vendor/bin/phpcs --standard=Magento2 Magento2/ --extensions=php

0 commit comments

Comments
 (0)