Skip to content

Commit

Permalink
Setting up Apigee X environment for ApigeeX testcases (#968)
Browse files Browse the repository at this point in the history
  • Loading branch information
shishir-intelli authored Nov 7, 2023
1 parent 807f6a6 commit ef4d8ee
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]'
Expand All @@ -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:
Expand All @@ -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:

Expand Down Expand Up @@ -106,11 +112,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: |
Expand All @@ -135,20 +147,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

0 comments on commit ef4d8ee

Please sign in to comment.