diff --git a/.github/workflows/acquia_cms_ci.workflow.yml b/.github/workflows/acquia_cms_ci.workflow.yml index 8541d694c3..facefed97a 100644 --- a/.github/workflows/acquia_cms_ci.workflow.yml +++ b/.github/workflows/acquia_cms_ci.workflow.yml @@ -11,6 +11,7 @@ on: jobs: static_code_analysis: if: ${{ github.event_name == 'pull_request' }} + name: ${{ matrix.acms_job }} (${{ matrix.orca-job }}) runs-on: ubuntu-latest env: # Provide your package's name. @@ -26,7 +27,7 @@ jobs: ORCA_JOB: ${{ matrix.orca-job }} GITHUB_EVENT: $ {{ github.event_name }} JOB_TYPE: "static-code-analysis" - #ACMS_JOB: ${{ matrix.acms-job}} + ACMS_JOB: ${{ matrix.acms-job}} # Google env variables. ORCA_GOOGLE_API_CLIENT_ID: ${{ secrets.ORCA_GOOGLE_API_CLIENT_ID }} ORCA_GOOGLE_API_CLIENT_SECRET: ${{ secrets.ORCA_GOOGLE_API_CLIENT_SECRET }} @@ -36,373 +37,10 @@ jobs: orca-job: - STATIC_CODE_ANALYSIS - STRICT_DEPRECATED_CODE_SCAN - #php-version: [ "8.1" ] - steps: - - uses: actions/checkout@v3 - - name: Use Node.js 12.13.1 - uses: actions/setup-node@v3 - with: - node-version: 12.13.1 - - uses: shivammathur/setup-php@v2 - with: - php-version: 8.2 - #coverage: xdebug - - name: Download ORCA - run: | - composer self-update - composer create-project --no-dev --ignore-platform-req=php acquia/orca ../orca "$ORCA_VERSION" -n - curl https://gist.githubusercontent.com/vishalkhode1/0e26b2e9637722a256c74a6cb8496e9d/raw/sut-path-reposories.patch | git -C ../orca apply - - name: Before Install - run: | - # Added below in CI to test acquia_cms on Drupal Core >=9.5. - composer require "drupal/core:>=9.5" --no-update --no-install -d modules/acquia_cms_common - sed -i 's/^core_version_requirement.*/core_version_requirement: ">=9.5"/' modules/acquia_cms_common/acquia_cms_common.info.yml - - ../orca/bin/ci/before_install.sh - - name: Install - shell: 'script -q -e -c "bash {0}"' - run: ./tests/ci/install.sh - - name: Before script - run: ../orca/bin/ci/before_script.sh - - name: Script - run: ./tests/ci/script.sh - - name: Before Cache - run: ../orca/bin/ci/before_cache.sh - - name: After script - run: | - ../orca/bin/ci/after_success.sh - ../orca/bin/ci/after_failure.sh - ../orca/bin/ci/after_script.sh - - drupal_check: - if: ${{ github.event_name == 'pull_request' }} - name: Execute Drupal-check - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php-version: - - "8.2" - # uncomment below once 8.3 have stable release. - # - "8.3" - steps: - - uses: actions/checkout@v3 - - name: Use Node.js 12.13.1 - uses: actions/setup-node@v3 - with: - node-version: 12.13.1 - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - #coverage: xdebug - - name: Execute Drupal-check - run: | - composer install - php vendor/bin/drupal-check modules - php vendor/bin/drupal-check tests/src - integrated_tests: - if: ${{ github.event_name == 'pull_request' }} - name: ${{ matrix.acms_job }} (${{ matrix.orca-job }}) - runs-on: ubuntu-latest - env: - # Site test artifacts. - # ACMS_DB_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms.sql.gz" - # ACMS_FILES_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms-files.tar.gz" - # ACMS_STARTER_DB_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms-starter.sql.gz" - # ACMS_STARTER_FILES_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms-files-starter.tar.gz" - # Provide your package's name. - ORCA_SUT_NAME: acquia/acquia_cms - ORCA_SUT_BRANCH: develop - ORCA_VERSION: ^3 - ORCA_PACKAGES_CONFIG_ALTER: ../acquia_cms/tests/packages_alter.yml - ORCA_FIXTURE_PROJECT_TEMPLATE: acquia/drupal-recommended-project - ORCA_ENABLE_NIGHTWATCH: "FALSE" - ORCA_PHPCS_STANDARD: AcquiaPHP - ORCA_SUT_DIR: /home/runner/work/acquia_cms/acquia_cms - COMPOSER_PROCESS_TIMEOUT: 1800 - ORCA_JOB: ${{ matrix.orca-job }} - # AWS_S3_BUCKET_PATH: s3://acquia-cms-artifacts/backstop - # Set Required API Keys. - CONNECTOR_ID: ${{ secrets.CONNECTOR_ID }} - SEARCH_UUID: ${{ secrets.SEARCH_UUID }} - CONNECTOR_KEY: ${{ secrets.CONNECTOR_KEY }} - GMAPS_KEY: ${{ secrets.GMAPS_KEY }} - SITESTUDIO_API_KEY: ${{ secrets.SITESTUDIO_API_KEY }} - SITESTUDIO_ORG_KEY: ${{ secrets.SITESTUDIO_ORG_KEY }} - ACMS_JOB: ${{ matrix.acms_job }} - JOB_TYPE: "integrated-tests" - CI: true - strategy: - fail-fast: false - matrix: - orca-job: - - ISOLATED_TEST_ON_CURRENT - #php-version: [ "8.1" ] acms_job: - - integrated_php_unit_tests - - integrated_existing_site_tests - steps: - - uses: actions/checkout@v3 - - name: Use Node.js 12.13.1 - uses: actions/setup-node@v3 - with: - node-version: 12.13.1 - - uses: shivammathur/setup-php@v2 - with: - php-version: 8.2 - #coverage: xdebug - - name: Setup MySQL - run: | - sudo /etc/init.d/mysql start - mysql -uroot -proot < ./tests/ci/install.sql - - name: Download ORCA - run: | - composer self-update - composer create-project --no-dev --ignore-platform-req=php acquia/orca ../orca "$ORCA_VERSION" -n - curl https://gist.githubusercontent.com/vishalkhode1/0e26b2e9637722a256c74a6cb8496e9d/raw/sut-path-reposories.patch | git -C ../orca apply - # - name: Configure AWS Credentials - # uses: aws-actions/configure-aws-credentials@v1 - # with: - # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # aws-region: ${{ secrets.AWS_DEFAULT_REGION }} - - name: Before Install - run: | - # Update the CI by adding patches without pinning the following modules. - composer require "drupal/facets:^2.0.6" --no-update --no-install -d modules/acquia_cms_search - composer require "drupal/pathauto:^1.11" --no-update --no-install -d modules/acquia_cms_common - - # Added below in CI to test acquia_cms on Drupal Core >=9.5. - composer require "drupal/core:>=9.5" --no-update --no-install -d modules/acquia_cms_common - sed -i 's/^core_version_requirement.*/core_version_requirement: ">=9.5"/' modules/acquia_cms_common/acquia_cms_common.info.yml - - # Remove all PHPUnit tests from individual modules, except the integrated & ExistingSite tests. - if [ "${ACMS_JOB}" = "integrated_existing_site_tests" ]; then - find modules/*/tests tests -type f -name "*Test.php" ! -path "*/ExistingSite*/*" -exec rm -fr '{}' ';' - elif [ "${ACMS_JOB}" = "integrated_php_unit_tests" ]; then - # Remove all isolated/existing_site phpunit tests from acquia_cms modules. - find modules/*/tests -type f -name "*Test.php" -exec rm -fr '{}' ';' - # Remove all existing_site phpunit tests from acquia_cms repo as those get's covered from integrated_existing_site_tests. - find tests/src -type f -name "*Test.php" -path "*/ExistingSite*/*" -exec rm -fr '{}' ';' - fi - ../orca/bin/ci/before_install.sh - chromedriver --disable-dev-shm-usage --disable-extensions --disable-gpu --headless --no-sandbox --port=4444 & - CHROMEDRIVER_PID=$! - echo "CHROMEDRIVER_PID=${CHROMEDRIVER_PID}" >> ${GITHUB_ENV} - - name: Install - shell: 'script -q -e -c "bash {0}"' - run: ./tests/ci/install.sh - - name: Before script - run: ../orca/bin/ci/before_script.sh - - name: Script - run: ./tests/ci/script.sh - - name: Before Cache - run : ../orca/bin/ci/before_cache.sh - - name: After script - run: | - kill -0 ${{ env.CHROMEDRIVER_PID }} - ../orca/bin/ci/after_success.sh - ../orca/bin/ci/after_failure.sh - ../orca/bin/ci/after_script.sh - backstop_tests: - if: ${{ github.event_name == 'pull_request' }} - name: backstop with ${{ matrix.orca-job }} on PHP ${{ matrix.php-version }} - runs-on: ubuntu-latest - env: - # Site test artifacts. - # ACMS_DB_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms.sql.gz" - # ACMS_FILES_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms-files.tar.gz" - # ACMS_STARTER_DB_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms-starter.sql.gz" - # ACMS_STARTER_FILES_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms-files-starter.tar.gz" - # Provide your package's name. - ORCA_SUT_NAME: acquia/acquia_cms - ORCA_SUT_BRANCH: develop - ORCA_VERSION: ${{ matrix.orca-version }} - ORCA_PACKAGES_CONFIG_ALTER: ../acquia_cms/tests/packages_alter.yml - ORCA_FIXTURE_PROJECT_TEMPLATE: acquia/drupal-recommended-project - ORCA_ENABLE_NIGHTWATCH: "FALSE" - ORCA_PHPCS_STANDARD: AcquiaPHP - ORCA_SUT_DIR: /home/runner/work/acquia_cms/acquia_cms - COMPOSER_PROCESS_TIMEOUT: 1800 - ORCA_JOB: ${{ matrix.orca-job }} - #AWS_S3_BUCKET_PATH: s3://acquia-cms-artifacts/backstop - # Set Required API Keys. - CONNECTOR_ID: ${{ secrets.CONNECTOR_ID }} - SEARCH_UUID: ${{ secrets.SEARCH_UUID }} - CONNECTOR_KEY: ${{ secrets.CONNECTOR_KEY }} - GMAPS_KEY: ${{ secrets.GMAPS_KEY }} - SITESTUDIO_API_KEY: ${{ secrets.SITESTUDIO_API_KEY }} - SITESTUDIO_ORG_KEY: ${{ secrets.SITESTUDIO_ORG_KEY }} - ACMS_JOB: "backstop_tests" - JOB_TYPE: "integrated-tests" - CI: true - strategy: - fail-fast: false - matrix: - orca-job: - - ISOLATED_TEST_ON_CURRENT - - INTEGRATED_TEST_ON_LATEST_LTS - php-version: - - 7.4 - - 8.1 - - 8.2 - orca-version: - - ^3 - - ^4 - exclude: - - orca-job: ISOLATED_TEST_ON_CURRENT - orca-version: ^3 - php-version: 7.4 - - orca-job: ISOLATED_TEST_ON_CURRENT - orca-version: ^3 - php-version: 8.1 - - orca-job: ISOLATED_TEST_ON_CURRENT - orca-version: ^3 - php-version: 8.2 - - orca-job: ISOLATED_TEST_ON_CURRENT - orca-version: ^4 - php-version: 7.4 - - orca-job: INTEGRATED_TEST_ON_LATEST_LTS - orca-version: ^3 - php-version: 8.1 - - orca-job: INTEGRATED_TEST_ON_LATEST_LTS - orca-version: ^3 - php-version: 8.2 - - orca-job: INTEGRATED_TEST_ON_LATEST_LTS - orca-version: ^4 - php-version: 7.4 - steps: - - uses: actions/checkout@v3 - - name: Use Node.js 12.13.1 - uses: actions/setup-node@v3 - with: - node-version: 12.13.1 - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - #coverage: xdebug - - name: Setup MySQL - run: | - sudo /etc/init.d/mysql start - mysql -uroot -proot < ./tests/ci/install.sql - - name: Download ORCA - run: | - composer self-update - composer create-project --no-dev --ignore-platform-req=php acquia/orca ../orca "$ORCA_VERSION" -n - curl https://gist.githubusercontent.com/vishalkhode1/0e26b2e9637722a256c74a6cb8496e9d/raw/sut-path-reposories.patch | git -C ../orca apply - # - name: Configure AWS Credentials - # uses: aws-actions/configure-aws-credentials@v1 - # with: - # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # aws-region: ${{ secrets.AWS_DEFAULT_REGION }} - - name: Before Install - run: | - # Added below in CI to test acquia_cms on Drupal Core >=9.5. - composer require "drupal/core:>=9.5" --no-update --no-install -d modules/acquia_cms_common - sed -i 's/^core_version_requirement.*/core_version_requirement: ">=9.5"/' modules/acquia_cms_common/acquia_cms_common.info.yml - - # Remove all PHPunit tests from acquia_cms modules. - find modules/*/tests tests/src -type f -name "*Test.php" -exec rm -fr '{}' ';' - - # Remove the failing php on Drupal Core 9.5. - if [ "${ORCA_JOB}" = "INTEGRATED_TEST_ON_LATEST_LTS" ]; then - # NEW_JSON=$(composer config extra.patches."drupal/core" | sed -r 's/,?"3328187.*3142.patch"//') - - # Remove drupal/core patch as it's needed for latest Drupal Core only. - composer config extra.patches.drupal/core {} --json - sed -i 's/2598.patch",/2599.patch"/' modules/acquia_cms_common/composer.json - sed -i '/3356894-mr_3896.patch/d' modules/acquia_cms_common/composer.json - sed -i '/296693-10.1.x_0.patch/d' modules/acquia_cms_common/composer.json - sed -i '/3165269bb01a5a8e5f53c1f369135b967c9d5924.patch/d' modules/acquia_cms_common/composer.json - sed -i '/3370946-page-title-backport-10-1-x.patch/d' modules/acquia_cms_common/composer.json - sed -i '/10.1-3347291-combine-mega-e.patch/d' modules/acquia_cms_common/composer.json - - # Change requireSameDimensions to true in backstop settings. - sed -i '54s/"requireSameDimensions": true/"requireSameDimensions": false/' tests/backstop/backstop-settings.js - sed -i '111s/"requireSameDimensions": true/"requireSameDimensions": false/' tests/backstop/backstop-settings.js - sed -i '130s/"requireSameDimensions": true/"requireSameDimensions": false/' tests/backstop/backstop-settings.js - sed -i '149s/"requireSameDimensions": true/"requireSameDimensions": false/' tests/backstop/backstop-settings.js - sed -i '168s/"requireSameDimensions": true/"requireSameDimensions": false/' tests/backstop/backstop-settings.js - sed -i '187s/"requireSameDimensions": true/"requireSameDimensions": false/' tests/backstop/backstop-settings.js - fi - ../orca/bin/ci/before_install.sh - chromedriver --disable-dev-shm-usage --disable-extensions --disable-gpu --headless --no-sandbox --port=4444 & - CHROMEDRIVER_PID=$! - echo "CHROMEDRIVER_PID=${CHROMEDRIVER_PID}" >> ${GITHUB_ENV} - - name: Install - shell: 'script -q -e -c "bash {0}"' - run: ./tests/ci/install.sh - - name: Before script - run: ../orca/bin/ci/before_script.sh - - name: Script - run: ./tests/ci/script.sh - - name: Before Cache - run: ../orca/bin/ci/before_cache.sh - - name: After script - run: | - kill -0 ${{ env.CHROMEDRIVER_PID }} - ../orca/bin/ci/after_success.sh - ../orca/bin/ci/after_failure.sh - ../orca/bin/ci/after_script.sh - isolated_tests: - if: ${{ github.event_name == 'pull_request' }} - name: acquia_cms (${{ matrix.orca-job }}, ${{ matrix.modules }}) - runs-on: ubuntu-latest - env: - # Set ORCA related environment variables. - ORCA_SUT_NAME: acquia/acquia_cms - ORCA_SUT_BRANCH: develop - ORCA_VERSION: ^3 - ORCA_PACKAGES_CONFIG_ALTER: ../acquia_cms/tests/packages_alter.yml - ORCA_FIXTURE_PROJECT_TEMPLATE: acquia/drupal-recommended-project - ORCA_ENABLE_NIGHTWATCH: "FALSE" - ORCA_PHPCS_STANDARD: AcquiaPHP - ORCA_SUT_DIR: /home/runner/work/acquia_cms/acquia_cms - ORCA_JOB: ${{ matrix.orca-job }} - - # Set Required API Keys. - CONNECTOR_ID: ${{ secrets.CONNECTOR_ID }} - SEARCH_UUID: ${{ secrets.SEARCH_UUID }} - CONNECTOR_KEY: ${{ secrets.CONNECTOR_KEY }} - GMAPS_KEY: ${{ secrets.GMAPS_KEY }} - SITESTUDIO_API_KEY: ${{ secrets.SITESTUDIO_API_KEY }} - SITESTUDIO_ORG_KEY: ${{ secrets.SITESTUDIO_ORG_KEY }} - - #Add other required environment variables. - COMPOSER_PROCESS_TIMEOUT: 1800 - MODULES: ${{ matrix.modules }} - JOB_TYPE: "isolated-tests" - CI: true - strategy: - fail-fast: false - matrix: - orca-job: - - ISOLATED_TEST_ON_CURRENT + - stylelint + - static_code_analysis #php-version: [ "8.1" ] - modules: - - acquia_cms_article, acquia_cms_person, acquia_cms_place, acquia_cms_event - - acquia_cms_page, acquia_cms_site_studio, sitestudio_config_management - - acquia_cms_image, acquia_cms_document, acquia_cms_video, acquia_cms_audio - - acquia_cms_search, acquia_cms_common, acquia_cms_tour - - acquia_cms_headless - # - acquia_cms_article - # - acquia_cms_audio - # - acquia_cms_common - # - acquia_cms_component - # - acquia_cms_dam - # - acquia_cms_document - # - acquia_cms_event - # - acquia_cms_image - # - acquia_cms_page - # - acquia_cms_person - # - acquia_cms_place - # - acquia_cms_search - # - acquia_cms_site_studio - # - acquia_cms_starter - # - acquia_cms_tour - # - acquia_cms_toolbar - # - acquia_cms_video steps: - uses: actions/checkout@v3 - name: Use Node.js 12.13.1 @@ -424,20 +62,7 @@ jobs: composer require "drupal/core:>=9.5" --no-update --no-install -d modules/acquia_cms_common sed -i 's/^core_version_requirement.*/core_version_requirement: ">=9.5"/' modules/acquia_cms_common/acquia_cms_common.info.yml - modules_list=$(echo ${MODULES} | tr "," "\n") - declare -a commands - for module in ${modules_list} - do - command=$(echo ${module} | xargs) - commands=("${commands[@]}" ! -path "*/${command}/*") - done - find modules -type f -name "*Test.php" "${commands[@]}" -exec rm -fr '{}' ';' - # Do not run any existing site tests. We run them seperately. - find modules -type d -name ExistingSite | xargs rm -rf && rm -rf tests/src/ ../orca/bin/ci/before_install.sh - chromedriver --disable-dev-shm-usage --disable-extensions --disable-gpu --headless --no-sandbox --port=4444 & - CHROMEDRIVER_PID=$! - echo "CHROMEDRIVER_PID=${CHROMEDRIVER_PID}" >> ${GITHUB_ENV} - name: Install shell: 'script -q -e -c "bash {0}"' run: ./tests/ci/install.sh @@ -449,132 +74,511 @@ jobs: run: ../orca/bin/ci/before_cache.sh - name: After script run: | - kill -0 ${{ env.CHROMEDRIVER_PID }} ../orca/bin/ci/after_success.sh ../orca/bin/ci/after_failure.sh ../orca/bin/ci/after_script.sh - run_update_hooks: - if: ${{ github.event_name == 'pull_request' }} - name: "Module Upgrades" - runs-on: ubuntu-latest - env: - # Set ORCA related environment variables. - ORCA_SUT_NAME: acquia/acquia_cms - ORCA_SUT_BRANCH: develop - ORCA_VERSION: ^3 - ORCA_PACKAGES_CONFIG_ALTER: ../acquia_cms/tests/packages_alter.yml - ORCA_FIXTURE_PROJECT_TEMPLATE: acquia/drupal-recommended-project - ORCA_ENABLE_NIGHTWATCH: "FALSE" - ORCA_SUT_DIR: /home/runner/work/acquia_cms/acquia_cms - - # Set Required API Keys. - CONNECTOR_ID: ${{ secrets.CONNECTOR_ID }} - SEARCH_UUID: ${{ secrets.SEARCH_UUID }} - CONNECTOR_KEY: ${{ secrets.CONNECTOR_KEY }} - GMAPS_KEY: ${{ secrets.GMAPS_KEY }} - SITESTUDIO_API_KEY: ${{ secrets.SITESTUDIO_API_KEY }} - SITESTUDIO_ORG_KEY: ${{ secrets.SITESTUDIO_ORG_KEY }} - - #Add other required environment variables. - COMPOSER_PROCESS_TIMEOUT: 1800 - CI: true - GIT_AUTHOR_NAME: "Github Actions" - GIT_AUTHOR_EMAIL: "github-actions@exmaple.com" - - GIT_COMMITTER_NAME: "Github Actions" - GIT_COMMITTER_EMAIL: "github-actions@exmaple.com" - ORCA_JOB: ISOLATED_TEST_ON_CURRENT - ACMS_JOB: "upgrade_modules" - strategy: - fail-fast: false - #php-version: [ "8.1" ] - steps: - - uses: actions/checkout@v3 - - name: Use Node.js 12.13.1 - uses: actions/setup-node@v3 - with: - node-version: 12.13.1 - - uses: shivammathur/setup-php@v2 - with: - php-version: 8.2 - #coverage: xdebug - - name: Setup MySQL - run: | - sudo /etc/init.d/mysql start - mysql -uroot -proot < ./tests/ci/install.sql - - name: Download ORCA - run: | - composer self-update - composer create-project --no-dev --ignore-platform-req=php acquia/orca ../orca "$ORCA_VERSION" -n - curl https://gist.githubusercontent.com/vishalkhode1/0e26b2e9637722a256c74a6cb8496e9d/raw/sut-path-reposories.patch | git -C ../orca apply - - name: Before Install - run: | - # Added below in CI to test acquia_cms on Drupal Core >=9.5. - composer require "drupal/core:>=9.5" --no-update --no-install -d modules/acquia_cms_common - sed -i 's/^core_version_requirement.*/core_version_requirement: ">=9.5"/' modules/acquia_cms_common/acquia_cms_common.info.yml - ./tests/ci/before_install.blt.sh - - name: Install - shell: 'script -q -e -c "bash {0}"' - run: ./tests/ci/install.sh - - name: Run Update hooks - shell: 'script -q -e -c "bash {0}"' - run: ./tests/ci/run_update_hooks.sh - env: - # @see ./tests/ci/before_install.blt.sh - DRUPAL_ORG_CHANGES: ${{ env.DRUPAL_ORG_CHANGES }} - - name: Script - run backstop tests - run: | - source ../orca/bin/ci/_includes.sh - cd ${ORCA_FIXTURE_DIR} - chromedriver --disable-dev-shm-usage --disable-extensions --disable-gpu --headless --no-sandbox --port=4444 & - CHROMEDRIVER_PID=$! - echo "CHROMEDRIVER_PID=${CHROMEDRIVER_PID}" >> ${GITHUB_ENV} - ./vendor/bin/drush en acquia_cms_development -y - ./vendor/bin/drush en acquia_cms_starter -y - ./vendor/bin/drush cr - cd ${ORCA_SUT_DIR} - ./tests/ci/script.sh - deploy_code: - if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} - name: "Continuous Deployment (CD)" - env: - GIT_AUTHOR_NAME: "Vishal Khode" - GIT_COMMITTER_NAME: "Vishal Khode" - GIT_COMMITTER_EMAIL: "vishal.khode@acquia.com" - GIT_AUTHOR_EMAIL: "vishal.khode@acquia.com" - AWS_S3_BUCKET_PATH: s3://acquia-cms-artifacts - runs-on: ubuntu-latest - environment: code_deployment - concurrency: production - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Configure SSH keys - run: | - mkdir -p ~/.ssh - echo "${DRUPAL_SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - eval `ssh-agent -s` - ssh-add ~/.ssh/id_rsa - ssh-keyscan "${DRUPAL_SSH_KNOWN_HOSTS}" >> ~/.ssh/known_hosts - shell: bash - env: - DRUPAL_SSH_PRIVATE_KEY: ${{ secrets.DRUPAL_SSH_PRIVATE_KEY }} - DRUPAL_SSH_KNOWN_HOSTS: git.drupal.org - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_DEFAULT_REGION }} - - name: Download Splitsh-lite - run: | - cd ${GITHUB_WORKSPACE}/scripts/ - aws s3 cp ${AWS_S3_BUCKET_PATH}/splitsh-lite/lite_linux_amd64.tar.gz . && tar xvzf lite_linux_amd64.tar.gz - chmod +x splitsh-lite - cd - - - name: deploy_code - run: | - ${GITHUB_WORKSPACE}/scripts/deploy_code.sh + # drupal_check: + # if: ${{ github.event_name == 'pull_request' }} + # name: Execute Drupal-check + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # php-version: + # - "8.2" + # # uncomment below once 8.3 have stable release. + # # - "8.3" + # steps: + # - uses: actions/checkout@v3 + # - name: Use Node.js 12.13.1 + # uses: actions/setup-node@v3 + # with: + # node-version: 12.13.1 + # - uses: shivammathur/setup-php@v2 + # with: + # php-version: ${{ matrix.php-version }} + # #coverage: xdebug + # - name: Execute Drupal-check + # run: | + # composer install + # php vendor/bin/drupal-check modules + # php vendor/bin/drupal-check tests/src + # integrated_tests: + # if: ${{ github.event_name == 'pull_request' }} + # name: ${{ matrix.acms_job }} (${{ matrix.orca-job }}) + # runs-on: ubuntu-latest + # env: + # # Site test artifacts. + # # ACMS_DB_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms.sql.gz" + # # ACMS_FILES_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms-files.tar.gz" + # # ACMS_STARTER_DB_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms-starter.sql.gz" + # # ACMS_STARTER_FILES_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms-files-starter.tar.gz" + # # Provide your package's name. + # ORCA_SUT_NAME: acquia/acquia_cms + # ORCA_SUT_BRANCH: develop + # ORCA_VERSION: ^3 + # ORCA_PACKAGES_CONFIG_ALTER: ../acquia_cms/tests/packages_alter.yml + # ORCA_FIXTURE_PROJECT_TEMPLATE: acquia/drupal-recommended-project + # ORCA_ENABLE_NIGHTWATCH: "FALSE" + # ORCA_PHPCS_STANDARD: AcquiaPHP + # ORCA_SUT_DIR: /home/runner/work/acquia_cms/acquia_cms + # COMPOSER_PROCESS_TIMEOUT: 1800 + # ORCA_JOB: ${{ matrix.orca-job }} + # # AWS_S3_BUCKET_PATH: s3://acquia-cms-artifacts/backstop + # # Set Required API Keys. + # CONNECTOR_ID: ${{ secrets.CONNECTOR_ID }} + # SEARCH_UUID: ${{ secrets.SEARCH_UUID }} + # CONNECTOR_KEY: ${{ secrets.CONNECTOR_KEY }} + # GMAPS_KEY: ${{ secrets.GMAPS_KEY }} + # SITESTUDIO_API_KEY: ${{ secrets.SITESTUDIO_API_KEY }} + # SITESTUDIO_ORG_KEY: ${{ secrets.SITESTUDIO_ORG_KEY }} + # ACMS_JOB: ${{ matrix.acms_job }} + # JOB_TYPE: "integrated-tests" + # CI: true + # strategy: + # fail-fast: false + # matrix: + # orca-job: + # - ISOLATED_TEST_ON_CURRENT + # #php-version: [ "8.1" ] + # acms_job: + # - integrated_php_unit_tests + # - integrated_existing_site_tests + # steps: + # - uses: actions/checkout@v3 + # - name: Use Node.js 12.13.1 + # uses: actions/setup-node@v3 + # with: + # node-version: 12.13.1 + # - uses: shivammathur/setup-php@v2 + # with: + # php-version: 8.2 + # #coverage: xdebug + # - name: Setup MySQL + # run: | + # sudo /etc/init.d/mysql start + # mysql -uroot -proot < ./tests/ci/install.sql + # - name: Download ORCA + # run: | + # composer self-update + # composer create-project --no-dev --ignore-platform-req=php acquia/orca ../orca "$ORCA_VERSION" -n + # curl https://gist.githubusercontent.com/vishalkhode1/0e26b2e9637722a256c74a6cb8496e9d/raw/sut-path-reposories.patch | git -C ../orca apply + # # - name: Configure AWS Credentials + # # uses: aws-actions/configure-aws-credentials@v1 + # # with: + # # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # # aws-region: ${{ secrets.AWS_DEFAULT_REGION }} + # - name: Before Install + # run: | + # # Update the CI by adding patches without pinning the following modules. + # composer require "drupal/facets:^2.0.6" --no-update --no-install -d modules/acquia_cms_search + # composer require "drupal/pathauto:^1.11" --no-update --no-install -d modules/acquia_cms_common + # + # # Added below in CI to test acquia_cms on Drupal Core >=9.5. + # composer require "drupal/core:>=9.5" --no-update --no-install -d modules/acquia_cms_common + # sed -i 's/^core_version_requirement.*/core_version_requirement: ">=9.5"/' modules/acquia_cms_common/acquia_cms_common.info.yml + # + # # Remove all PHPUnit tests from individual modules, except the integrated & ExistingSite tests. + # if [ "${ACMS_JOB}" = "integrated_existing_site_tests" ]; then + # find modules/*/tests tests -type f -name "*Test.php" ! -path "*/ExistingSite*/*" -exec rm -fr '{}' ';' + # elif [ "${ACMS_JOB}" = "integrated_php_unit_tests" ]; then + # # Remove all isolated/existing_site phpunit tests from acquia_cms modules. + # find modules/*/tests -type f -name "*Test.php" -exec rm -fr '{}' ';' + # # Remove all existing_site phpunit tests from acquia_cms repo as those get's covered from integrated_existing_site_tests. + # find tests/src -type f -name "*Test.php" -path "*/ExistingSite*/*" -exec rm -fr '{}' ';' + # fi + # ../orca/bin/ci/before_install.sh + # chromedriver --disable-dev-shm-usage --disable-extensions --disable-gpu --headless --no-sandbox --port=4444 & + # CHROMEDRIVER_PID=$! + # echo "CHROMEDRIVER_PID=${CHROMEDRIVER_PID}" >> ${GITHUB_ENV} + # - name: Install + # shell: 'script -q -e -c "bash {0}"' + # run: ./tests/ci/install.sh + # - name: Before script + # run: ../orca/bin/ci/before_script.sh + # - name: Script + # run: ./tests/ci/script.sh + # - name: Before Cache + # run : ../orca/bin/ci/before_cache.sh + # - name: After script + # run: | + # kill -0 ${{ env.CHROMEDRIVER_PID }} + # ../orca/bin/ci/after_success.sh + # ../orca/bin/ci/after_failure.sh + # ../orca/bin/ci/after_script.sh + # backstop_tests: + # if: ${{ github.event_name == 'pull_request' }} + # name: backstop with ${{ matrix.orca-job }} on PHP ${{ matrix.php-version }} + # runs-on: ubuntu-latest + # env: + # # Site test artifacts. + # # ACMS_DB_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms.sql.gz" + # # ACMS_FILES_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms-files.tar.gz" + # # ACMS_STARTER_DB_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms-starter.sql.gz" + # # ACMS_STARTER_FILES_ARTIFACT: "/home/runner/work/acquia_cms/acquia_cms/tests/acms-files-starter.tar.gz" + # # Provide your package's name. + # ORCA_SUT_NAME: acquia/acquia_cms + # ORCA_SUT_BRANCH: develop + # ORCA_VERSION: ${{ matrix.orca-version }} + # ORCA_PACKAGES_CONFIG_ALTER: ../acquia_cms/tests/packages_alter.yml + # ORCA_FIXTURE_PROJECT_TEMPLATE: acquia/drupal-recommended-project + # ORCA_ENABLE_NIGHTWATCH: "FALSE" + # ORCA_PHPCS_STANDARD: AcquiaPHP + # ORCA_SUT_DIR: /home/runner/work/acquia_cms/acquia_cms + # COMPOSER_PROCESS_TIMEOUT: 1800 + # ORCA_JOB: ${{ matrix.orca-job }} + # #AWS_S3_BUCKET_PATH: s3://acquia-cms-artifacts/backstop + # # Set Required API Keys. + # CONNECTOR_ID: ${{ secrets.CONNECTOR_ID }} + # SEARCH_UUID: ${{ secrets.SEARCH_UUID }} + # CONNECTOR_KEY: ${{ secrets.CONNECTOR_KEY }} + # GMAPS_KEY: ${{ secrets.GMAPS_KEY }} + # SITESTUDIO_API_KEY: ${{ secrets.SITESTUDIO_API_KEY }} + # SITESTUDIO_ORG_KEY: ${{ secrets.SITESTUDIO_ORG_KEY }} + # ACMS_JOB: "backstop_tests" + # JOB_TYPE: "integrated-tests" + # CI: true + # strategy: + # fail-fast: false + # matrix: + # orca-job: + # - ISOLATED_TEST_ON_CURRENT + # - INTEGRATED_TEST_ON_LATEST_LTS + # php-version: + # - 7.4 + # - 8.1 + # - 8.2 + # orca-version: + # - ^3 + # - ^4 + # exclude: + # - orca-job: ISOLATED_TEST_ON_CURRENT + # orca-version: ^3 + # php-version: 7.4 + # - orca-job: ISOLATED_TEST_ON_CURRENT + # orca-version: ^3 + # php-version: 8.1 + # - orca-job: ISOLATED_TEST_ON_CURRENT + # orca-version: ^3 + # php-version: 8.2 + # - orca-job: ISOLATED_TEST_ON_CURRENT + # orca-version: ^4 + # php-version: 7.4 + # - orca-job: INTEGRATED_TEST_ON_LATEST_LTS + # orca-version: ^3 + # php-version: 8.1 + # - orca-job: INTEGRATED_TEST_ON_LATEST_LTS + # orca-version: ^3 + # php-version: 8.2 + # - orca-job: INTEGRATED_TEST_ON_LATEST_LTS + # orca-version: ^4 + # php-version: 7.4 + # steps: + # - uses: actions/checkout@v3 + # - name: Use Node.js 12.13.1 + # uses: actions/setup-node@v3 + # with: + # node-version: 12.13.1 + # - uses: shivammathur/setup-php@v2 + # with: + # php-version: ${{ matrix.php-version }} + # #coverage: xdebug + # - name: Setup MySQL + # run: | + # sudo /etc/init.d/mysql start + # mysql -uroot -proot < ./tests/ci/install.sql + # - name: Download ORCA + # run: | + # composer self-update + # composer create-project --no-dev --ignore-platform-req=php acquia/orca ../orca "$ORCA_VERSION" -n + # curl https://gist.githubusercontent.com/vishalkhode1/0e26b2e9637722a256c74a6cb8496e9d/raw/sut-path-reposories.patch | git -C ../orca apply + # # - name: Configure AWS Credentials + # # uses: aws-actions/configure-aws-credentials@v1 + # # with: + # # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # # aws-region: ${{ secrets.AWS_DEFAULT_REGION }} + # - name: Before Install + # run: | + # # Added below in CI to test acquia_cms on Drupal Core >=9.5. + # composer require "drupal/core:>=9.5" --no-update --no-install -d modules/acquia_cms_common + # sed -i 's/^core_version_requirement.*/core_version_requirement: ">=9.5"/' modules/acquia_cms_common/acquia_cms_common.info.yml + # + # # Remove all PHPunit tests from acquia_cms modules. + # find modules/*/tests tests/src -type f -name "*Test.php" -exec rm -fr '{}' ';' + # + # # Remove the failing php on Drupal Core 9.5. + # if [ "${ORCA_JOB}" = "INTEGRATED_TEST_ON_LATEST_LTS" ]; then + # # NEW_JSON=$(composer config extra.patches."drupal/core" | sed -r 's/,?"3328187.*3142.patch"//') + # + # # Remove drupal/core patch as it's needed for latest Drupal Core only. + # composer config extra.patches.drupal/core {} --json + # sed -i 's/2598.patch",/2599.patch"/' modules/acquia_cms_common/composer.json + # sed -i '/3356894-mr_3896.patch/d' modules/acquia_cms_common/composer.json + # sed -i '/296693-10.1.x_0.patch/d' modules/acquia_cms_common/composer.json + # sed -i '/3165269bb01a5a8e5f53c1f369135b967c9d5924.patch/d' modules/acquia_cms_common/composer.json + # sed -i '/3370946-page-title-backport-10-1-x.patch/d' modules/acquia_cms_common/composer.json + # sed -i '/10.1-3347291-combine-mega-e.patch/d' modules/acquia_cms_common/composer.json + # + # # Change requireSameDimensions to true in backstop settings. + # sed -i '54s/"requireSameDimensions": true/"requireSameDimensions": false/' tests/backstop/backstop-settings.js + # sed -i '111s/"requireSameDimensions": true/"requireSameDimensions": false/' tests/backstop/backstop-settings.js + # sed -i '130s/"requireSameDimensions": true/"requireSameDimensions": false/' tests/backstop/backstop-settings.js + # sed -i '149s/"requireSameDimensions": true/"requireSameDimensions": false/' tests/backstop/backstop-settings.js + # sed -i '168s/"requireSameDimensions": true/"requireSameDimensions": false/' tests/backstop/backstop-settings.js + # sed -i '187s/"requireSameDimensions": true/"requireSameDimensions": false/' tests/backstop/backstop-settings.js + # fi + # ../orca/bin/ci/before_install.sh + # chromedriver --disable-dev-shm-usage --disable-extensions --disable-gpu --headless --no-sandbox --port=4444 & + # CHROMEDRIVER_PID=$! + # echo "CHROMEDRIVER_PID=${CHROMEDRIVER_PID}" >> ${GITHUB_ENV} + # - name: Install + # shell: 'script -q -e -c "bash {0}"' + # run: ./tests/ci/install.sh + # - name: Before script + # run: ../orca/bin/ci/before_script.sh + # - name: Script + # run: ./tests/ci/script.sh + # - name: Before Cache + # run: ../orca/bin/ci/before_cache.sh + # - name: After script + # run: | + # kill -0 ${{ env.CHROMEDRIVER_PID }} + # ../orca/bin/ci/after_success.sh + # ../orca/bin/ci/after_failure.sh + # ../orca/bin/ci/after_script.sh + # isolated_tests: + # if: ${{ github.event_name == 'pull_request' }} + # name: acquia_cms (${{ matrix.orca-job }}, ${{ matrix.modules }}) + # runs-on: ubuntu-latest + # env: + # # Set ORCA related environment variables. + # ORCA_SUT_NAME: acquia/acquia_cms + # ORCA_SUT_BRANCH: develop + # ORCA_VERSION: ^3 + # ORCA_PACKAGES_CONFIG_ALTER: ../acquia_cms/tests/packages_alter.yml + # ORCA_FIXTURE_PROJECT_TEMPLATE: acquia/drupal-recommended-project + # ORCA_ENABLE_NIGHTWATCH: "FALSE" + # ORCA_PHPCS_STANDARD: AcquiaPHP + # ORCA_SUT_DIR: /home/runner/work/acquia_cms/acquia_cms + # ORCA_JOB: ${{ matrix.orca-job }} + # + # # Set Required API Keys. + # CONNECTOR_ID: ${{ secrets.CONNECTOR_ID }} + # SEARCH_UUID: ${{ secrets.SEARCH_UUID }} + # CONNECTOR_KEY: ${{ secrets.CONNECTOR_KEY }} + # GMAPS_KEY: ${{ secrets.GMAPS_KEY }} + # SITESTUDIO_API_KEY: ${{ secrets.SITESTUDIO_API_KEY }} + # SITESTUDIO_ORG_KEY: ${{ secrets.SITESTUDIO_ORG_KEY }} + # + # #Add other required environment variables. + # COMPOSER_PROCESS_TIMEOUT: 1800 + # MODULES: ${{ matrix.modules }} + # JOB_TYPE: "isolated-tests" + # CI: true + # strategy: + # fail-fast: false + # matrix: + # orca-job: + # - ISOLATED_TEST_ON_CURRENT + # #php-version: [ "8.1" ] + # modules: + # - acquia_cms_article, acquia_cms_person, acquia_cms_place, acquia_cms_event + # - acquia_cms_page, acquia_cms_site_studio, sitestudio_config_management + # - acquia_cms_image, acquia_cms_document, acquia_cms_video, acquia_cms_audio + # - acquia_cms_search, acquia_cms_common, acquia_cms_tour + # - acquia_cms_headless + # # - acquia_cms_article + # # - acquia_cms_audio + # # - acquia_cms_common + # # - acquia_cms_component + # # - acquia_cms_dam + # # - acquia_cms_document + # # - acquia_cms_event + # # - acquia_cms_image + # # - acquia_cms_page + # # - acquia_cms_person + # # - acquia_cms_place + # # - acquia_cms_search + # # - acquia_cms_site_studio + # # - acquia_cms_starter + # # - acquia_cms_tour + # # - acquia_cms_toolbar + # # - acquia_cms_video + # steps: + # - uses: actions/checkout@v3 + # - name: Use Node.js 12.13.1 + # uses: actions/setup-node@v3 + # with: + # node-version: 12.13.1 + # - uses: shivammathur/setup-php@v2 + # with: + # php-version: 8.2 + # #coverage: xdebug + # - name: Download ORCA + # run: | + # composer self-update + # composer create-project --no-dev --ignore-platform-req=php acquia/orca ../orca "$ORCA_VERSION" -n + # curl https://gist.githubusercontent.com/vishalkhode1/0e26b2e9637722a256c74a6cb8496e9d/raw/sut-path-reposories.patch | git -C ../orca apply + # - name: Before Install + # run: | + # # Added below in CI to test acquia_cms on Drupal Core >=9.5. + # composer require "drupal/core:>=9.5" --no-update --no-install -d modules/acquia_cms_common + # sed -i 's/^core_version_requirement.*/core_version_requirement: ">=9.5"/' modules/acquia_cms_common/acquia_cms_common.info.yml + # + # modules_list=$(echo ${MODULES} | tr "," "\n") + # declare -a commands + # for module in ${modules_list} + # do + # command=$(echo ${module} | xargs) + # commands=("${commands[@]}" ! -path "*/${command}/*") + # done + # find modules -type f -name "*Test.php" "${commands[@]}" -exec rm -fr '{}' ';' + # # Do not run any existing site tests. We run them seperately. + # find modules -type d -name ExistingSite | xargs rm -rf && rm -rf tests/src/ + # ../orca/bin/ci/before_install.sh + # chromedriver --disable-dev-shm-usage --disable-extensions --disable-gpu --headless --no-sandbox --port=4444 & + # CHROMEDRIVER_PID=$! + # echo "CHROMEDRIVER_PID=${CHROMEDRIVER_PID}" >> ${GITHUB_ENV} + # - name: Install + # shell: 'script -q -e -c "bash {0}"' + # run: ./tests/ci/install.sh + # - name: Before script + # run: ../orca/bin/ci/before_script.sh + # - name: Script + # run: ./tests/ci/script.sh + # - name: Before Cache + # run: ../orca/bin/ci/before_cache.sh + # - name: After script + # run: | + # kill -0 ${{ env.CHROMEDRIVER_PID }} + # ../orca/bin/ci/after_success.sh + # ../orca/bin/ci/after_failure.sh + # ../orca/bin/ci/after_script.sh + # run_update_hooks: + # if: ${{ github.event_name == 'pull_request' }} + # name: "Module Upgrades" + # runs-on: ubuntu-latest + # env: + # # Set ORCA related environment variables. + # ORCA_SUT_NAME: acquia/acquia_cms + # ORCA_SUT_BRANCH: develop + # ORCA_VERSION: ^3 + # ORCA_PACKAGES_CONFIG_ALTER: ../acquia_cms/tests/packages_alter.yml + # ORCA_FIXTURE_PROJECT_TEMPLATE: acquia/drupal-recommended-project + # ORCA_ENABLE_NIGHTWATCH: "FALSE" + # ORCA_SUT_DIR: /home/runner/work/acquia_cms/acquia_cms + # + # # Set Required API Keys. + # CONNECTOR_ID: ${{ secrets.CONNECTOR_ID }} + # SEARCH_UUID: ${{ secrets.SEARCH_UUID }} + # CONNECTOR_KEY: ${{ secrets.CONNECTOR_KEY }} + # GMAPS_KEY: ${{ secrets.GMAPS_KEY }} + # SITESTUDIO_API_KEY: ${{ secrets.SITESTUDIO_API_KEY }} + # SITESTUDIO_ORG_KEY: ${{ secrets.SITESTUDIO_ORG_KEY }} + # + # #Add other required environment variables. + # COMPOSER_PROCESS_TIMEOUT: 1800 + # CI: true + # GIT_AUTHOR_NAME: "Github Actions" + # GIT_AUTHOR_EMAIL: "github-actions@exmaple.com" + # + # GIT_COMMITTER_NAME: "Github Actions" + # GIT_COMMITTER_EMAIL: "github-actions@exmaple.com" + # ORCA_JOB: ISOLATED_TEST_ON_CURRENT + # ACMS_JOB: "upgrade_modules" + # strategy: + # fail-fast: false + # #php-version: [ "8.1" ] + # steps: + # - uses: actions/checkout@v3 + # - name: Use Node.js 12.13.1 + # uses: actions/setup-node@v3 + # with: + # node-version: 12.13.1 + # - uses: shivammathur/setup-php@v2 + # with: + # php-version: 8.2 + # #coverage: xdebug + # - name: Setup MySQL + # run: | + # sudo /etc/init.d/mysql start + # mysql -uroot -proot < ./tests/ci/install.sql + # - name: Download ORCA + # run: | + # composer self-update + # composer create-project --no-dev --ignore-platform-req=php acquia/orca ../orca "$ORCA_VERSION" -n + # curl https://gist.githubusercontent.com/vishalkhode1/0e26b2e9637722a256c74a6cb8496e9d/raw/sut-path-reposories.patch | git -C ../orca apply + # - name: Before Install + # run: | + # # Added below in CI to test acquia_cms on Drupal Core >=9.5. + # composer require "drupal/core:>=9.5" --no-update --no-install -d modules/acquia_cms_common + # sed -i 's/^core_version_requirement.*/core_version_requirement: ">=9.5"/' modules/acquia_cms_common/acquia_cms_common.info.yml + # ./tests/ci/before_install.blt.sh + # - name: Install + # shell: 'script -q -e -c "bash {0}"' + # run: ./tests/ci/install.sh + # - name: Run Update hooks + # shell: 'script -q -e -c "bash {0}"' + # run: ./tests/ci/run_update_hooks.sh + # env: + # # @see ./tests/ci/before_install.blt.sh + # DRUPAL_ORG_CHANGES: ${{ env.DRUPAL_ORG_CHANGES }} + # - name: Script - run backstop tests + # run: | + # source ../orca/bin/ci/_includes.sh + # cd ${ORCA_FIXTURE_DIR} + # chromedriver --disable-dev-shm-usage --disable-extensions --disable-gpu --headless --no-sandbox --port=4444 & + # CHROMEDRIVER_PID=$! + # echo "CHROMEDRIVER_PID=${CHROMEDRIVER_PID}" >> ${GITHUB_ENV} + # ./vendor/bin/drush en acquia_cms_development -y + # ./vendor/bin/drush en acquia_cms_starter -y + # ./vendor/bin/drush cr + # cd ${ORCA_SUT_DIR} + # ./tests/ci/script.sh + # + # deploy_code: + # if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} + # name: "Continuous Deployment (CD)" + # env: + # GIT_AUTHOR_NAME: "Vishal Khode" + # GIT_COMMITTER_NAME: "Vishal Khode" + # GIT_COMMITTER_EMAIL: "vishal.khode@acquia.com" + # GIT_AUTHOR_EMAIL: "vishal.khode@acquia.com" + # AWS_S3_BUCKET_PATH: s3://acquia-cms-artifacts + # runs-on: ubuntu-latest + # environment: code_deployment + # concurrency: production + # steps: + # - uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + # - name: Configure SSH keys + # run: | + # mkdir -p ~/.ssh + # echo "${DRUPAL_SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa + # chmod 600 ~/.ssh/id_rsa + # eval `ssh-agent -s` + # ssh-add ~/.ssh/id_rsa + # ssh-keyscan "${DRUPAL_SSH_KNOWN_HOSTS}" >> ~/.ssh/known_hosts + # shell: bash + # env: + # DRUPAL_SSH_PRIVATE_KEY: ${{ secrets.DRUPAL_SSH_PRIVATE_KEY }} + # DRUPAL_SSH_KNOWN_HOSTS: git.drupal.org + # - name: Configure AWS Credentials + # uses: aws-actions/configure-aws-credentials@v1 + # with: + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # aws-region: ${{ secrets.AWS_DEFAULT_REGION }} + # - name: Download Splitsh-lite + # run: | + # cd ${GITHUB_WORKSPACE}/scripts/ + # aws s3 cp ${AWS_S3_BUCKET_PATH}/splitsh-lite/lite_linux_amd64.tar.gz . && tar xvzf lite_linux_amd64.tar.gz + # chmod +x splitsh-lite + # cd - + # - name: deploy_code + # run: | + # ${GITHUB_WORKSPACE}/scripts/deploy_code.sh diff --git a/tests/ci/script.sh b/tests/ci/script.sh index 8e35806ab8..2298a502e4 100755 --- a/tests/ci/script.sh +++ b/tests/ci/script.sh @@ -14,7 +14,7 @@ cd "$(dirname "$0")" # Reuse ORCA's own includes. source ../../../orca/bin/travis/_includes.sh -if [ "${ACMS_JOB}" != "backstop_tests" ] && [ "${ACMS_JOB}" != "upgrade_modules" ] && [ "${ACMS_JOB}" != "cypress_tests" ]; then +if [ "${ACMS_JOB}" != "backstop_tests" ] && [ "${ACMS_JOB}" != "upgrade_modules" ] && [ "${ACMS_JOB}" != "cypress_tests" ] && [ "${ACMS_JOB}" != "stylelint" ]; then # Run ORCA's standard script. ../../../orca/bin/travis/script.sh fi @@ -44,3 +44,13 @@ if [ "${ACMS_JOB}" == "cypress_tests" ]; then # Runs Cypress tests npx cypress run fi + +if [ "${ACMS_JOB}" == "stylelint" ]; then + # Install npm dependencies and run JS test suites. + cd ${ORCA_SUT_DIR} + npm install + orca fixture:run-server & + + # Runs Cypress tests + npx stylelint --formatter --config ./docroot/core/.stylelintrc.json modules/**/*.css +fi