From e6535ee364fa71277db24633fb60cb4e5bc39bed Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Wed, 27 Apr 2022 21:53:43 +0300 Subject: [PATCH 1/4] Use Configuration::outputDir() logDir() was removed in Codeception 5.0 outputDir() was introduced in Codeception 2.0 --- c3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c3.php b/c3.php index 3c59a62..08b1cb8 100644 --- a/c3.php +++ b/c3.php @@ -121,7 +121,7 @@ class_alias('PHPUnit\Runner\Version', 'PHPUnit_Runner_Version'); ini_set('memory_limit', $requiredMemory); } - define('C3_CODECOVERAGE_MEDIATE_STORAGE', Codeception\Configuration::logDir() . 'c3tmp'); + define('C3_CODECOVERAGE_MEDIATE_STORAGE', Codeception\Configuration::outputDir() . 'c3tmp'); define('C3_CODECOVERAGE_PROJECT_ROOT', Codeception\Configuration::projectDir()); define('C3_CODECOVERAGE_TESTNAME', $_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE']); From 32ad536b5ff9462dacc3c55fecd18943e1e826b0 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Thu, 28 Apr 2022 09:26:55 +0300 Subject: [PATCH 2/4] CI: Run tests agains 4.1 branch --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1b2cc3f..547e90f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,8 +64,8 @@ jobs: - name: Install dependencies run: | - composer require codeception/codeception:"^4.1" --dev --prefer-source - composer require codeception/module-filesystem codeception/module-cli codeception/module-asserts codeception/module-phpbrowser --dev + composer require codeception/codeception:"4.1.x-dev" --dev --prefer-source + composer require codeception/module-filesystem:"^1.0" codeception/module-cli:"^1.0" codeception/module-asserts:"^1.0|^2.0" codeception/module-phpbrowser:"^1.0" --dev cp c3.php vendor/codeception/codeception/tests/data/claypit - name: Start PHP Server @@ -99,8 +99,8 @@ jobs: - name: Install dependencies run: | - composer require codeception/codeception:"^4.1" --dev --prefer-source - composer require codeception/module-filesystem codeception/module-cli codeception/module-asserts codeception/module-phpbrowser --dev + composer require codeception/codeception:"4.1.x-dev" --dev --prefer-source + composer require codeception/module-filesystem:"^1.0" codeception/module-cli:"^1.0" codeception/module-asserts:"^1.0|^2.0" codeception/module-phpbrowser:"^1.0" --dev cp c3.php vendor/codeception/codeception/tests/data/claypit - name: Start PHP Server From 7aec0cfe6268a3bf574d6cb0d239e4ba41751772 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Thu, 28 Apr 2022 11:11:28 +0300 Subject: [PATCH 3/4] CI: Run 4.1 tests on PHP 8.1 --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 547e90f..aa7b772 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,7 +45,7 @@ jobs: strategy: matrix: - php: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0] + php: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1] steps: - name: Checkout code @@ -80,7 +80,7 @@ jobs: strategy: matrix: - php: [7.2, 7.3, 7.4, 8.0] + php: [7.2, 7.3, 7.4, 8.0, 8.1] steps: - name: Checkout code From 13ecfebff09bab3313fb2b84de98633d1f9c6eb3 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Thu, 28 Apr 2022 13:59:19 +0300 Subject: [PATCH 4/4] CI: Run tests against Codeception 5 --- .github/workflows/main.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa7b772..444b9f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,3 +109,38 @@ jobs: - name: Run test suite run: cd vendor/codeception/codeception && php ./codecept run coverage + + codeception5: + runs-on: ubuntu-latest + + strategy: + matrix: + php: [8.0, 8.1] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + + - name: Use Composer v2 + run: composer self-update --2 + + - name: Validate composer.json + run: composer validate + + - name: Install dependencies + run: | + composer require codeception/codeception:"5.0.x-dev as 5.0.0" --dev --prefer-source + composer require codeception/module-filesystem:"^3.0" codeception/module-cli:"^2.0" codeception/module-asserts:"^3.0" codeception/module-phpbrowser:"^3.0" --dev + cp c3.php vendor/codeception/codeception/tests/data/claypit + + - name: Start PHP Server + run: | + cd vendor/codeception/codeception && php -S 127.0.0.1:8008 -t tests/data/app -d pcov.directory=$(pwd)/tests/data/app >/dev/null 2>&1 & + + - name: Run test suite + run: cd vendor/codeception/codeception && php ./codecept run coverage