From 304015de9420b0b9c4e42a5a0a5184fa7f2318f1 Mon Sep 17 00:00:00 2001 From: Shishir Suvarna Date: Fri, 3 Nov 2023 11:23:27 +0530 Subject: [PATCH] Setting up Apigee X environment for ApigeeX testcases --- .github/workflows/php.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index bf9d395d2..85d7c2d6d 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -9,6 +9,9 @@ env: APIGEE_EDGE_INSTANCE_TYPE: ${{ secrets.APIGEE_EDGE_INSTANCE_TYPE }} APIGEE_INTEGRATION_ENABLE: ${{ secrets.APIGEE_INTEGRATION_ENABLE }} APIGEE_EDGE_ENDPOINT: ${{ secrets.APIGEE_EDGE_ENDPOINT }} + APIGEE_EDGE_ACCOUNT_JSON_KEY: ${{ secrets.APIGEE_EDGE_ACCOUNT_JSON_KEY }} + APIGEE_EDGE_HYBRID_ENDPOINT: ${{ secrets.APIGEE_EDGE_HYBRID_ENDPOINT }} + APIGEE_EDGE_HYBRID_ORGANIZATION: ${{ secrets.APIGEE_EDGE_HYBRID_ORGANIZATION }} BROWSERTEST_OUTPUT_DIRECTORY: "sites/simpletest/browser_output" BROWSERTEST_OUTPUT_BASE_URL: "" MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", { "chromeOptions": { "w3c": false } }, "http://127.0.0.1:9515/wd/hub"]' @@ -24,7 +27,7 @@ jobs: runs-on: ubuntu-latest - name: "PHP ${{ matrix.php-version }} | Drupal ${{ matrix.drupal-core }}" + name: "PHP ${{ matrix.php-version }} | Drupal ${{ matrix.drupal-core }} | ${{ matrix.instance-type }}" strategy: fail-fast: false matrix: @@ -34,6 +37,9 @@ jobs: drupal-core: # Should update the following as the minimum supported version from Drupal.org - "10.1.x" + instance-type: + - "Edge" + - "X" steps: @@ -105,11 +111,17 @@ jobs: vendor/bin/drush en apigee_edge -y vendor/bin/drush rs 8000 & - - name: "PHPCS" + - name: "PHPCS and setting up Apigee X environment" + if: ${{ matrix.instance-type == 'X' }} run: | cd drupal cp modules/contrib/apigee_edge/phpcs.xml.dist . vendor/bin/phpcs --standard=./phpcs.xml.dist modules/contrib/apigee_edge -p -s -n --colors + # Setting environment variables to run Apigee X tests + echo "APIGEE_EDGE_INSTANCE_TYPE=hybrid" >> $GITHUB_ENV + echo "APIGEE_EDGE_ORGANIZATION=$APIGEE_EDGE_HYBRID_ORGANIZATION" >> $GITHUB_ENV + echo "APIGEE_EDGE_ENDPOINT=$APIGEE_EDGE_HYBRID_ENDPOINT" >> $GITHUB_ENV + composer show > composer-show.txt - name: "Drupal check" run: | @@ -134,20 +146,20 @@ jobs: run: | cd drupal cp modules/contrib/apigee_edge/phpunit.core.xml.dist core/phpunit.xml - vendor/bin/phpunit -c core --verbose --color --group apigee_edge --testsuite unit,kernel,functional,functional-javascript --debug --coverage-clover /tmp/coverage.xml modules/contrib/apigee_edge + vendor/bin/phpunit -c core --verbose --color --group apigee_edge --testsuite unit,kernel,functional,functional-javascript --debug --coverage-clover /tmp/coverage_${{ matrix.instance-type }}.xml modules/contrib/apigee_edge - name: Artifacts if: failure() uses: actions/upload-artifact@v3 with: - name: browser-output-${{ matrix.php-version }}-${{ matrix.drupal-core }}-artifact + name: browser-output-${{ matrix.php-version }}-${{ matrix.drupal-core }}-${{ matrix.instance-type }}-artifact path: drupal/sites/simpletest/browser_output/* - name: Upload coverage to Codecov if: ${{ matrix.drupal-core == '9.5.x' && matrix.php-version == '8.1' }} uses: codecov/codecov-action@v3 with: - files: /tmp/coverage.xml + files: /tmp/coverage_${{ matrix.instance-type }}.xml name: codecov-umbrella fail_ci_if_error: true verbose: true