Skip to content

Commit 724b7eb

Browse files
committed
Add github actions.
1 parent fc550bf commit 724b7eb

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

.github/workflows/build.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
on:
2+
- pull_request
3+
- push
4+
5+
name: build
6+
7+
jobs:
8+
tests:
9+
name: PHP ${{ matrix.php }}-${{ matrix.os }}-${{ matrix.coverage }}
10+
11+
env:
12+
extensions: curl, mbstring, openssl, pdo, pdo_sqlite
13+
SYMFONY_DEPRECATIONS_HELPER: weak
14+
15+
runs-on: ${{ matrix.os }}
16+
17+
continue-on-error: ${{ matrix.experimental }}
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ubuntu-latest]
23+
php: ["5.6", "7.0", "7.1", "7.2"]
24+
coverage: [xdebug]
25+
experimental: [false]
26+
include:
27+
- os: ubuntu-latest
28+
php: "7.3"
29+
coverage: pcov
30+
experimental: true
31+
- os: ubuntu-latest
32+
php: "7.4"
33+
coverage: pcov
34+
experimental: true
35+
- os: ubuntu-latest
36+
php: "8.0"
37+
coverage: pcov
38+
experimental: true
39+
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v2.3.4
43+
44+
- name: Install PHP
45+
uses: shivammathur/setup-php@v2
46+
with:
47+
php-version: ${{ matrix.php }}
48+
extensions: ${{ env.extensions }}
49+
ini-values: memory_limit=-1, date.timezone='UTC'
50+
coverage: ${{ matrix.coverage }}
51+
tools: composer:v2
52+
53+
- name: Determine composer cache directory on Linux
54+
if: matrix.os == 'ubuntu-latest'
55+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
56+
57+
- name: Determine composer cache directory on Windows
58+
if: matrix.os == 'windows-latest'
59+
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
60+
61+
- name: Cache dependencies installed with composer
62+
uses: actions/cache@v2
63+
with:
64+
path: ${{ env.COMPOSER_CACHE_DIR }}
65+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
66+
restore-keys: |
67+
php${{ matrix.php }}-composer-
68+
69+
- name: Update composer
70+
run: composer self-update
71+
72+
- name: Validate composer.json
73+
run: composer validate
74+
75+
- name: Composer install
76+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
77+
78+
- name: Run tests PHP 5.6, 7.0, 7.1, 7.3, 8.0
79+
if: matrix.php != '7.2' || matrix.php != '7.4'
80+
run: |
81+
php -S 127.0.0.1:8000 -t tests/data/app >/dev/null 2>&1 &
82+
php codecept build
83+
php codecept run cli,unit
84+
85+
- name: Run tests PHP 7.2, 7.4
86+
if: matrix.php == '7.2' || matrix.php == '7.4'
87+
run: |
88+
php -S 127.0.0.1:8000 -t tests/data/app -d pcov.directory=$(pwd)/tests/data/app >/dev/null 2>&1 &
89+
php codecept build
90+
php codecept run cli,unit,coverage --env COVERAGE=1

0 commit comments

Comments
 (0)