Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Commit 1b9a08f

Browse files
committed
Merge branch 'master' into 2.x
2 parents 5ae7911 + bf353aa commit 1b9a08f

File tree

9 files changed

+60
-14
lines changed

9 files changed

+60
-14
lines changed

.github/workflows/integration.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ name: "Integration tests"
22

33
on:
44
push:
5+
branches:
6+
- dev
57
pull_request:
68

79
env:
810
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
911
BITRIX24_PHP_SDK_PLAYGROUND_WEBHOOK: ${{ secrets.BITRIX24_PHP_SDK_PLAYGROUND_WEBHOOK }}
12+
TEST2_ENV: 12345
13+
1014
jobs:
1115
tests:
1216
name: "Integration tests"
@@ -20,6 +24,7 @@ jobs:
2024
dependencies: [ highest ]
2125

2226
steps:
27+
2328
- name: "Checkout"
2429
uses: "actions/checkout@v2"
2530

@@ -28,10 +33,29 @@ jobs:
2833
with:
2934
coverage: "none"
3035
php-version: "${{ matrix.php-version }}"
36+
ini-values: variables_order=EGPCS
37+
env:
38+
BITRIX24_PHP_SDK_PLAYGROUND_WEBHOOK: ${{ secrets.BITRIX24_PHP_SDK_PLAYGROUND_WEBHOOK }}
39+
TEST2_ENV: 12345
3140

3241
- name: "Install dependencies"
3342
run: |
3443
composer update ${{ env.COMPOSER_FLAGS }}
3544
36-
- name: "run unit tests"
37-
run: "composer phpunit-run-integration-tests"
45+
- name: "Debug ENV variables"
46+
run: |
47+
printenv
48+
49+
- name: "Run integration tests"
50+
run: |
51+
composer phpunit-run-integration-tests
52+
53+
- name: "is integration tests succeeded"
54+
if: ${{ success() }}
55+
run: |
56+
echo '✅ integration tests pass, congratulations!'
57+
58+
- name: "is integration tests failed"
59+
if: ${{ failure() }}
60+
run: |
61+
echo '::error:: ❗️iteintegration tests failed '

.github/workflows/phpstan.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,14 @@ jobs:
4040
run: "composer update --no-interaction --no-progress --no-suggest"
4141

4242
- name: "PHPStan"
43-
run: "composer phpstan-analyse"
43+
run: "composer phpstan-analyse"
44+
45+
- name: "is PHPStan check succeeded"
46+
if: ${{ success() }}
47+
run: |
48+
echo '✅ PHPStan check pass, congratulations!'
49+
50+
- name: "is PHPStan check failed"
51+
if: ${{ failure() }}
52+
run: |
53+
echo '::error:: ❗️ PHPStan check failed (╯°益°)╯彡┻━┻'

.github/workflows/phpunit.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,14 @@ jobs:
3434
composer update ${{ env.COMPOSER_FLAGS }}
3535
3636
- name: "run unit tests"
37-
run: "composer phpunit-run-unit-tests"
37+
run: "composer phpunit-run-unit-tests"
38+
39+
- name: "is unit tests tests succeeded"
40+
if: ${{ success() }}
41+
run: |
42+
echo '✅ unit tests pass, congratulations!'
43+
44+
- name: "is unit tests tests failed"
45+
if: ${{ failure() }}
46+
run: |
47+
echo '::error:: ❗️ unit tests tests failed (╯°益°)╯彡┻━┻'

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
in `Bitrix24\SDK\Core\Response::__destruct()`
1919
* add `Bitrix24\SDK\Core\BulkItemsReader` for data-intensive applications for bulk export data from Bitrix24, read strategies located in
2020
folder `ReadStrategies`, in services read model **must** use most effective read strategy.
21+
* add integration tests in GitHub Actions pipeline 🎉, now integration tests run on push on `dev-branch`
2122

2223
### Changed
2324

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ A powerful PHP library for the Bitrix24 REST API
77

88
### Build status
99

10-
[![phpstan check](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/phpstan.yml/badge.svg)](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/phpstan.yml)
11-
[![phpunit unit-tests status](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/phpunit.yml/badge.svg)](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/phpunit.yml)
10+
| CI\CD [status](https://github.com/mesilov/bitrix24-php-sdk/actions) |
11+
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
12+
| [![phpstan check](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/phpstan.yml/badge.svg)](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/phpstan.yml) |
13+
| [![unit-tests status](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/phpunit.yml/badge.svg)](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/phpunit.yml) |
14+
| [![integration-tests status](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/integration.yml/badge.svg)](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/integration.yml) |
15+
16+
Integration tests run in GitHub actions with real Bitrix24 portal
17+
1218

1319
### BITRIX24-PHP-SDK Documentation
1420

tests/Integration/Fabric.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ public static function getBulkItemsReader(): BulkItemsReaderInterface
4747
*/
4848
public static function getCore(): CoreInterface
4949
{
50-
51-
print(print_r($_ENV, true));
52-
print(print_r($_ENV['BITRIX24_PHP_SDK_PLAYGROUND_WEBHOOK']));
53-
print(print_r($_ENV['BITRIX24_WEBHOOK']));
54-
exit();
55-
5650
return (new CoreBuilder())
5751
->withLogger(self::getLogger())
5852
->withWebhookUrl($_ENV['BITRIX24_PHP_SDK_PLAYGROUND_WEBHOOK'] ?? $_ENV['BITRIX24_WEBHOOK'])

tests/Unit/Core/Result/AbstractItemTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function testSetPropertyItem(): void
2525
};
2626
$testItem->ID = 2;
2727
}
28+
2829
/**
2930
* @covers \Bitrix24\SDK\Core\Result\AbstractItem::__unset
3031
*/

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
putenv('APP_DEBUG=' . $_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
2121
}
2222

23-
(new Dotenv())->loadEnv(dirname(__DIR__).'/tests/.env');
23+
(new Dotenv())->loadEnv(dirname(__DIR__) . '/tests/.env');

tools/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
APP_ENV=dev
22
LOGS_FILE=tools/logs/cli.log
3-
LOGS_LEVEL=200
3+
LOGS_LEVEL=300

0 commit comments

Comments
 (0)