-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
139 lines (108 loc) · 4.19 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
on:
pull_request:
branches-ignore: gh-pages
push:
branches-ignore: gh-pages
name: build
jobs:
linux:
name: PHP ${{ matrix.php }}-${{ matrix.os }}
env:
extensions: curl, mbstring, openssl, pdo, pdo_sqlite
SYMFONY_DEPRECATIONS_HELPER: weak
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: ["7.3", "7.4", "8.0"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
ini-values: memory_limit=-1, date.timezone='UTC'
coverage: xdebug
tools: composer:v2
- name: Determine composer cache directory
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update
- name: Validate composer.json
run: composer validate
- name: Composer install
run: composer install --no-interaction --no-progress --optimize-autoloader --ansi
- name: Run tests without code coverage on PHP 7.3, 7.4
if: matrix.php == '7.3' || matrix.php == '7.4'
run: |
php -S 127.0.0.1:8008 -t tests/data/app >/dev/null 2>&1 &
php codecept build
php codecept run cli,unit
- name: Run tests with code coverage on PHP 7.2, 8.0
if: matrix.php == '7.2' || matrix.php == '8.0'
run: |
php -S 127.0.0.1:8008 -t tests/data/app -d pcov.directory=$(pwd)/tests/data/app >/dev/null 2>&1 &
php codecept build
php codecept run cli,unit,coverage --env COVERAGE=1
- name: Run module-asserts tests
run: php codecept run -c vendor/codeception/module-asserts/
- name: Run module-filesystem tests
run: php codecept run -c vendor/codeception/module-filesystem/
- name: Run module-db sqlite tests
run: php codecept run -c vendor/codeception/module-db/ unit :Sqlite
- name: Run module-phpbrowser tests
run: |
cd vendor/codeception/module-phpbrowser/
php -S 127.0.0.1:8000 -t tests/data/app >/dev/null 2>&1 &
php -S 127.0.0.1:8010 -t tests/data/rest >/dev/null 2>&1 &
php ../../../codecept run tests/unit/Codeception/Module/PhpBrowserTest.php
windows-latest:
name: PHP ${{ matrix.php }}-${{ matrix.os }}
env:
extensions: curl, mbstring, openssl, pdo, pdo_sqlite
SYMFONY_DEPRECATIONS_HELPER: weak
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
php: ["7.3", "7.4", "8.0"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
ini-values: memory_limit=-1, date.timezone='UTC'
tools: composer:v2
- name: Determine composer cache directory
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update
- name: Validate composer.json
run: composer validate
- name: Composer install
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Run tests cli
run: php codecept run cli --skip-group coverage
- name: Run tests unit
run: php codecept run unit -g core -g appveyor