diff --git a/.github/workflows/integration-v4.yml b/.github/workflows/integration-v4.yml new file mode 100644 index 0000000..b570983 --- /dev/null +++ b/.github/workflows/integration-v4.yml @@ -0,0 +1,62 @@ +name: "Integration tests" + +on: + push: + branches: + - v4 + - master + +env: + COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist" + LOYALTY_API_ENDPOINT_URL: ${{ secrets.LOYALTY_API_ENDPOINT_URL }} + LOYALTY_API_CLIENT_ID: ${{ secrets.LOYALTY_API_CLIENT_ID }} + LOYALTY_API_ADMIN_KEY: ${{ secrets.LOYALTY_API_ADMIN_KEY }} + +jobs: + tests: + name: "Integration tests" + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + php-version: + - "8.2" + - "8.3" + dependencies: [ highest ] + operating-system: [ ubuntu-latest, windows-latest ] + + steps: + + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + ini-values: variables_order=EGPCS + env: + BITRIX24_PHP_SDK_PLAYGROUND_WEBHOOK: ${{ secrets.BITRIX24_PHP_SDK_PLAYGROUND_WEBHOOK }} + + - name: "Install dependencies" + run: | + composer update ${{ env.COMPOSER_FLAGS }} + + - name: "Debug ENV variables" + run: | + printenv + + - name: "Run integration tests" + run: | + php vendor/bin/phpunit --colors=always --testsuite integration-tests + + - name: "integration tests succeeded" + if: ${{ success() }} + run: | + echo '✅ integration tests pass, congratulations!' + + - name: "integration tests failed" + if: ${{ failure() }} + run: | + echo '::error:: ❗integration tests failed (╯°益°)╯彡┻━┻ ' \ No newline at end of file diff --git a/tests/.env.local b/tests/.env.local deleted file mode 100644 index 8a906d8..0000000 --- a/tests/.env.local +++ /dev/null @@ -1,23 +0,0 @@ -# In all environments, the following files are loaded if they exist, -# the latter taking precedence over the former: -# -# * .env contains default values for the environment variables needed by the app -# * .env.local uncommitted file with local overrides -# * .env.$APP_ENV committed environment-specific defaults -# * .env.$APP_ENV.local uncommitted environment-specific overrides -# -# Real environment variables win over .env files. -# -# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. -# -# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). -# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration - -APP_ENV=dev -# monolog log level -INTEGRATION_TEST_LOG_LEVEL=100 - - -LOYALTY_API_ENDPOINT_URL=https://loyalty.b24.cloud -LOYALTY_API_CLIENT_ID=e3fa28cd-e245-4e9c-9e98-fab2a37ac964 -LOYALTY_API_ADMIN_KEY=f0a71cb6-d4fd-440e-9971-cbd5e7c33590