Skip to content

Commit 9e9635d

Browse files
authored
[FEATURE] Run tests on Github Actions (#32)
1 parent a2b3326 commit 9e9635d

File tree

2 files changed

+57
-41
lines changed

2 files changed

+57
-41
lines changed

.github/workflows/tests.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "Tests"
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
env:
8+
fail-fast: true
9+
10+
jobs:
11+
phpunit:
12+
name: "PHPUnit"
13+
runs-on: "ubuntu-20.04"
14+
15+
strategy:
16+
matrix:
17+
php-version:
18+
- "7.2"
19+
- "7.3"
20+
- "7.4"
21+
symfony-version:
22+
- "3.4.x"
23+
- "4.4.x"
24+
- "5.0.x"
25+
- "5.1.x"
26+
27+
steps:
28+
- name: "Checkout"
29+
uses: "actions/checkout@v2"
30+
with:
31+
fetch-depth: 2
32+
33+
- name: "Install PHP"
34+
uses: "shivammathur/setup-php@v2"
35+
with:
36+
php-version: "${{ matrix.php-version }}"
37+
38+
- name: Get composer cache directory
39+
id: composer-cache
40+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
41+
42+
- name: Cache composer dependencies
43+
uses: actions/cache@v2
44+
with:
45+
path: ${{ steps.composer-cache.outputs.dir }}
46+
# Use composer.json for key, if composer.lock is not committed.
47+
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
48+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
49+
restore-keys: ${{ runner.os }}-composer-
50+
51+
- name: Install Composer dependencies
52+
run: |
53+
composer require --dev --no-update symfony/framework-bundle:${{ matrix.symfony-version }}
54+
composer install --no-progress --prefer-dist --optimize-autoloader
55+
56+
- name: Run Tests
57+
run: php vendor/bin/phpunit --coverage-text

.travis.yml

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

0 commit comments

Comments
 (0)