Skip to content

Commit 556d5ad

Browse files
authored
Merge pull request Codeception#6046 from terabytesoftw/add-github-actions
Add github actions.
2 parents fc550bf + 8a8b0d9 commit 556d5ad

File tree

5 files changed

+136
-92
lines changed

5 files changed

+136
-92
lines changed

.github/workflows/build.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
on:
2+
pull_request:
3+
branches-ignore: gh-pages
4+
push:
5+
branches-ignore: gh-pages
6+
7+
name: build
8+
9+
jobs:
10+
linux:
11+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
12+
13+
env:
14+
extensions: curl, mbstring, openssl, pdo, pdo_sqlite
15+
SYMFONY_DEPRECATIONS_HELPER: weak
16+
17+
runs-on: ${{ matrix.os }}
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ubuntu-latest]
23+
php: ["5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0"]
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v2
28+
29+
- name: Install PHP
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: ${{ matrix.php }}
33+
extensions: ${{ env.extensions }}
34+
ini-values: memory_limit=-1, date.timezone='UTC'
35+
coverage: xdebug
36+
tools: composer:v2
37+
38+
- name: Determine composer cache directory
39+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
40+
41+
- name: Cache dependencies installed with composer
42+
uses: actions/cache@v2
43+
with:
44+
path: ${{ env.COMPOSER_CACHE_DIR }}
45+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
46+
restore-keys: |
47+
php${{ matrix.php }}-composer-
48+
49+
- name: Update composer
50+
run: composer self-update
51+
52+
- name: Validate composer.json
53+
run: composer validate
54+
55+
- name: Composer install
56+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
57+
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'
60+
run: |
61+
php -S 127.0.0.1:8000 -t tests/data/app >/dev/null 2>&1 &
62+
php codecept build
63+
php codecept run cli,unit
64+
65+
- name: Run tests PHP 7.2, 7.4
66+
if: matrix.php == '7.2' || matrix.php == '7.4'
67+
run: |
68+
php -S 127.0.0.1:8000 -t tests/data/app -d pcov.directory=$(pwd)/tests/data/app >/dev/null 2>&1 &
69+
php codecept build
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+
run: |
75+
php -S 127.0.0.1:8000 -t tests/data/app -d pcov.directory=$(pwd)/tests/data/app >/dev/null 2>&1 &
76+
php codecept build
77+
php codecept run cli,unit,coverage --env COVERAGE=1
78+
79+
windows-latest:
80+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
81+
82+
env:
83+
extensions: curl, mbstring, openssl, pdo, pdo_sqlite
84+
SYMFONY_DEPRECATIONS_HELPER: weak
85+
86+
runs-on: ${{ matrix.os }}
87+
88+
strategy:
89+
fail-fast: false
90+
matrix:
91+
os: [windows-latest]
92+
93+
php: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0"]
94+
95+
steps:
96+
- name: Checkout
97+
uses: actions/checkout@v2
98+
99+
- name: Install PHP
100+
uses: shivammathur/setup-php@v2
101+
with:
102+
php-version: ${{ matrix.php }}
103+
extensions: ${{ env.extensions }}
104+
ini-values: memory_limit=-1, date.timezone='UTC'
105+
tools: composer:v2
106+
107+
- name: Determine composer cache directory
108+
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
109+
110+
- name: Cache dependencies installed with composer
111+
uses: actions/cache@v2
112+
with:
113+
path: ${{ env.COMPOSER_CACHE_DIR }}
114+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
115+
restore-keys: |
116+
php${{ matrix.php }}-composer-
117+
118+
- name: Update composer
119+
run: composer self-update
120+
121+
- name: Validate composer.json
122+
run: composer validate
123+
124+
- name: Composer install
125+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
126+
127+
- name: Run tests cli
128+
run: php codecept run cli --skip-group coverage
129+
130+
- name: Run tests unit
131+
run: php codecept run unit -g core -g appveyor

.travis.yml

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

appveyor.yml

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

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"codeception/module-db": "*@dev",
4242
"codeception/module-filesystem": "*@dev",
4343
"codeception/module-phpbrowser": "*@dev",
44-
"codeception/util-universalframework": "*@dev"
44+
"codeception/util-universalframework": "*@dev",
45+
"phpunit/phpunit": "<9.5"
4546
},
4647
"suggest": {
4748
"hoa/console": "For interactive console functionality",

readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ Codeception is a modern full-stack testing framework for PHP.
1010
Inspired by BDD, it provides an absolutely new way of writing acceptance, functional and even unit tests.
1111
Powered by PHPUnit.
1212

13-
| General | Windows | Webdriver |
14-
| ------- | -------- | -------- |
15-
| [![Build Status](https://secure.travis-ci.org/Codeception/Codeception.png?branch=4.0)](http://travis-ci.org/Codeception/Codeception) | [![Build status](https://ci.appveyor.com/api/projects/status/ntjj9i4y67d1rb7y?svg=true)](https://ci.appveyor.com/project/DavertMik/codeception/branch/4.0) | [![Build Status](https://semaphoreci.com/api/v1/codeception/codeception/branches/3-0/shields_badge.svg)](https://semaphoreci.com/codeception/codeception) |
13+
| Build | Webdriver |
14+
| ----- | -------- |
15+
| [![Build status](https://github.com/Codeception/Codeception/workflows/build/badge.svg)](https://github.com/Codeception/Codeception/actions?query=workflow%3Abuild) | [![Build Status](https://semaphoreci.com/api/v1/codeception/codeception/branches/3-0/shields_badge.svg)](https://semaphoreci.com/codeception/codeception) |
1616

1717
#### Contributions
1818

0 commit comments

Comments
 (0)