Skip to content

Commit 9d8d5f0

Browse files
committed
Update workflow.
1 parent 724b7eb commit 9d8d5f0

File tree

1 file changed

+75
-33
lines changed

1 file changed

+75
-33
lines changed

.github/workflows/build.yml

Lines changed: 75 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,43 @@
11
on:
2-
- pull_request
3-
- push
2+
pull_request:
3+
branches-ignore: gh-pages
4+
push:
5+
branches-ignore: gh-pages
46

57
name: build
68

79
jobs:
8-
tests:
9-
name: PHP ${{ matrix.php }}-${{ matrix.os }}-${{ matrix.coverage }}
10+
linux:
11+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
1012

1113
env:
1214
extensions: curl, mbstring, openssl, pdo, pdo_sqlite
1315
SYMFONY_DEPRECATIONS_HELPER: weak
1416

1517
runs-on: ${{ matrix.os }}
1618

17-
continue-on-error: ${{ matrix.experimental }}
18-
1919
strategy:
2020
fail-fast: false
2121
matrix:
2222
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
23+
php: ["5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0"]
3924

4025
steps:
4126
- name: Checkout
42-
uses: actions/checkout@v2.3.4
27+
uses: actions/checkout@v2
4328

4429
- name: Install PHP
4530
uses: shivammathur/setup-php@v2
4631
with:
4732
php-version: ${{ matrix.php }}
4833
extensions: ${{ env.extensions }}
4934
ini-values: memory_limit=-1, date.timezone='UTC'
50-
coverage: ${{ matrix.coverage }}
35+
coverage: xdebug
5136
tools: composer:v2
5237

53-
- name: Determine composer cache directory on Linux
54-
if: matrix.os == 'ubuntu-latest'
38+
- name: Determine composer cache directory
5539
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
5640

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-
6141
- name: Cache dependencies installed with composer
6242
uses: actions/cache@v2
6343
with:
@@ -75,8 +55,8 @@ jobs:
7555
- name: Composer install
7656
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
7757

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'
58+
- name: Run tests PHP 5.6, 7.0, 7.1, 7.3
59+
if: matrix.php == '56' || matrix.php == '7.0' || matrix.php == '7.1' || matrix.php == '7.3'
8060
run: |
8161
php -S 127.0.0.1:8000 -t tests/data/app >/dev/null 2>&1 &
8262
php codecept build
@@ -87,4 +67,66 @@ jobs:
8767
run: |
8868
php -S 127.0.0.1:8000 -t tests/data/app -d pcov.directory=$(pwd)/tests/data/app >/dev/null 2>&1 &
8969
php codecept build
90-
php codecept run cli,unit,coverage --env COVERAGE=1
70+
php codecept run cli,unit,coverage --env COVERAGE=1
71+
72+
- name: Run tests PHP 8.0
73+
if: matrix.php == '8.0'
74+
continue-on-error: true
75+
run: |
76+
php -S 127.0.0.1:8000 -t tests/data/app -d pcov.directory=$(pwd)/tests/data/app >/dev/null 2>&1 &
77+
php codecept build
78+
php codecept run cli,unit,coverage --env COVERAGE=1
79+
80+
windows-latest:
81+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
82+
83+
env:
84+
extensions: curl, mbstring, openssl, pdo, pdo_sqlite
85+
SYMFONY_DEPRECATIONS_HELPER: weak
86+
87+
runs-on: ${{ matrix.os }}
88+
89+
strategy:
90+
fail-fast: false
91+
matrix:
92+
os: [windows-latest]
93+
94+
php: ["7.1"]
95+
96+
steps:
97+
- name: Checkout
98+
uses: actions/checkout@v2
99+
100+
- name: Install PHP
101+
uses: shivammathur/setup-php@v2
102+
with:
103+
php-version: ${{ matrix.php }}
104+
extensions: ${{ env.extensions }}
105+
ini-values: memory_limit=-1, date.timezone='UTC'
106+
tools: composer:v2
107+
108+
- name: Determine composer cache directory
109+
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
110+
111+
- name: Cache dependencies installed with composer
112+
uses: actions/cache@v2
113+
with:
114+
path: ${{ env.COMPOSER_CACHE_DIR }}
115+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
116+
restore-keys: |
117+
php${{ matrix.php }}-composer-
118+
119+
- name: Update composer
120+
run: composer self-update
121+
122+
- name: Validate composer.json
123+
run: composer validate
124+
125+
- name: Composer install
126+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
127+
128+
- name: Run tests cli
129+
run: php codecept run cli --skip-group coverage
130+
131+
- name: Run tests unit
132+
run: php codecept run unit -g core -g appveyor

0 commit comments

Comments
 (0)