diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0e2b0ad..d16dd2f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,3 @@ -## -# Managed by https://github.com/localgovdrupal/github_workflow_manager ---- name: Test localgovdrupal/localgov_services drupal-module on: @@ -10,205 +7,11 @@ on: pull_request: branches: - '2.x' - -env: - LOCALGOV_DRUPAL_PROJECT: localgovdrupal/localgov_services - LOCALGOV_DRUPAL_PROJECT_PATH: web/modules/contrib/localgov_services + workflow_dispatch: jobs: - - build: - name: Install LocalGov Drupal - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - localgov-version: - - '3.x' - drupal-version: - - '~10.0' - php-version: - - '8.1' - - '8.2' - - steps: - - - name: Save git branch and git repo names to env if this is not a pull request - if: github.event_name != 'pull_request' - run: | - echo "GIT_BASE=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV - echo "GIT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV - echo "HEAD_USER=localgovdrupal" >> $GITHUB_ENV - - - name: Save git branch and git repo names to env if this is a pull request - if: github.event_name == 'pull_request' - run: | - echo "GIT_BASE=${GITHUB_BASE_REF}" >> $GITHUB_ENV - echo "GIT_BRANCH=${GITHUB_HEAD_REF}" >> $GITHUB_ENV - export HEAD="${{ github.event.pull_request.head.label }}" - echo "HEAD_USER=${HEAD%%:*}" >> $GITHUB_ENV - - - name: Set composer branch reference for version branches - if: endsWith(github.ref, '.x') - run: echo "COMPOSER_REF=${GIT_BRANCH}-dev" >> $GITHUB_ENV - - - name: Set composer branch reference for non-version branches - if: endsWith(github.ref, '.x') == false - run: echo "COMPOSER_REF=dev-${GIT_BRANCH}" >> $GITHUB_ENV - - - name: Get the latest tagged release for branch version - run: | - LATEST_RELEASE=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_REPOSITORY}/git/matching-refs/tags/${GIT_BASE%'.x'} | grep -Po '(?<=refs/tags/)[^"]+' | tail -1) - if [ -z $LATEST_RELEASE ]; then LATEST_RELEASE=1; fi - echo "LATEST_RELEASE=${LATEST_RELEASE}" >> $GITHUB_ENV - - - name: Cached workspace - uses: actions/cache@v2 - with: - path: ./html - key: localgov-build-${{ matrix.localgov-version }}-${{ matrix.drupal-version }}-${{ matrix.php-version }}-${{ github.run_id }}-${{ secrets.CACHE_VERSION }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - - - name: Clone drupal_container - uses: actions/checkout@v2 - with: - repository: localgovdrupal/drupal-container - ref: php${{ matrix.php-version }} - - - name: Create LocalGov Drupal project - run: | - composer create-project --stability dev --no-install localgovdrupal/localgov-project ./html "${{ matrix.localgov-version }}" - composer --working-dir=./html require --no-install localgovdrupal/localgov:${{ matrix.localgov-version }}-dev - composer --working-dir=./html require --no-install drupal/core-recommended:${{ matrix.drupal-version }} drupal/core-composer-scaffold:${{ matrix.drupal-version }} drupal/core-project-message:${{ matrix.drupal-version }} drupal/core-dev:${{ matrix.drupal-version }} - composer --working-dir=./html install - - - name: Obtain the test target using Composer - if: env.HEAD_USER == 'localgovdrupal' - run: | - composer --working-dir=html config repositories.1 vcs git@github.com:${LOCALGOV_DRUPAL_PROJECT}.git - composer global config github-oauth.github.com ${{ github.token }} - composer --working-dir=./html require --with-all-dependencies ${LOCALGOV_DRUPAL_PROJECT}:"${COMPOSER_REF} as ${LATEST_RELEASE}" - - - name: Obtain the test target using Git - if: env.HEAD_USER != 'localgovdrupal' - uses: actions/checkout@v2 - with: - path: ${{ env.LOCALGOV_DRUPAL_PROJECT_PATH }} - - phpcs: - name: Coding standards checks - needs: build - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - localgov-version: - - '3.x' - drupal-version: - - '~10.0' - php-version: - - '8.1' - - '8.2' - - steps: - - - name: Cached workspace - uses: actions/cache@v2 - with: - path: ./html - key: localgov-build-${{ matrix.localgov-version }}-${{ matrix.drupal-version }}-${{ matrix.php-version }}-${{ github.run_id }}-${{ secrets.CACHE_VERSION }} - restore-keys: | - localgov-build-${{ matrix.localgov-version }}-${{ matrix.drupal-version }}-${{ matrix.php-version }}- - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - - - name: Run coding standards checks - run: | - cd html - ./bin/phpcs -p ${LOCALGOV_DRUPAL_PROJECT_PATH} - - phpstan: - name: Deprecated code checks - needs: build - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - localgov-version: - - '3.x' - drupal-version: - - '~10.0' - php-version: - - '8.1' - - '8.2' - - steps: - - - name: Cached workspace - uses: actions/cache@v2 - with: - path: ./html - key: localgov-build-${{ matrix.localgov-version }}-${{ matrix.drupal-version }}-${{ matrix.php-version }}-${{ github.run_id }}-${{ secrets.CACHE_VERSION }} - restore-keys: | - localgov-build-${{ matrix.localgov-version }}-${{ matrix.drupal-version }}-${{ matrix.php-version }}- - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - - - name: Run deprecated code checks - run: | - cd html - ./bin/phpstan analyse -c ./phpstan.neon ${LOCALGOV_DRUPAL_PROJECT_PATH} - phpunit: - name: PHPUnit tests - needs: build - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - localgov-version: - - '3.x' - drupal-version: - - '~10.0' - php-version: - - '8.1' - - '8.2' - - steps: - - - name: Clone Drupal container - uses: actions/checkout@v2 - with: - repository: localgovdrupal/drupal-container - ref: php${{ matrix.php-version }} - - - name: Cached workspace - uses: actions/cache@v2 - with: - path: ./html - key: localgov-build-${{ matrix.localgov-version }}-${{ matrix.drupal-version }}-${{ matrix.php-version }}-${{ github.run_id }}-${{ secrets.CACHE_VERSION }} - restore-keys: | - localgov-build-${{ matrix.localgov-version }}-${{ matrix.drupal-version }}-${{ matrix.php-version }}- - - - name: Start Docker environment - run: docker-compose -f docker-compose.yml up -d - - - name: Run PHPUnit tests - run: | - mkdir -p ./html/web/sites/simpletest && chmod 777 ./html/web/sites/simpletest - sed -i "s#http://localgov.lndo.site#http://drupal#" ./html/phpunit.xml.dist - docker exec -t drupal bash -c 'chown docker:docker -R /var/www/html' - docker exec -u docker -t drupal bash -c "cd /var/www/html && ./bin/paratest --processes=4 /var/www/html/${{ env.LOCALGOV_DRUPAL_PROJECT_PATH }}" + tests: + uses: localgovdrupal/localgov_shared_workflows/.github/workflows/test-module.yml@1.x + with: + project: 'localgovdrupal/localgov_services' + project_path: 'web/modules/contrib/localgov_services' diff --git a/modules/localgov_services_landing/config/install/core.entity_form_display.node.localgov_services_landing.default.yml b/modules/localgov_services_landing/config/install/core.entity_form_display.node.localgov_services_landing.default.yml index 3344d3a..2f9701e 100644 --- a/modules/localgov_services_landing/config/install/core.entity_form_display.node.localgov_services_landing.default.yml +++ b/modules/localgov_services_landing/config/install/core.entity_form_display.node.localgov_services_landing.default.yml @@ -88,6 +88,7 @@ third_party_settings: classes: '' id: '' direction: vertical + width_breakpoint: 1138 group_social_media: children: - localgov_twitter diff --git a/modules/localgov_services_navigation/tests/src/FunctionalJavascript/EntityReferenceServicesAutocompleteTest.php b/modules/localgov_services_navigation/tests/src/FunctionalJavascript/EntityReferenceServicesAutocompleteTest.php index 34d8445..8c6f979 100644 --- a/modules/localgov_services_navigation/tests/src/FunctionalJavascript/EntityReferenceServicesAutocompleteTest.php +++ b/modules/localgov_services_navigation/tests/src/FunctionalJavascript/EntityReferenceServicesAutocompleteTest.php @@ -91,6 +91,7 @@ public function testServicesEntityReferenceAutocompleteWidget() { $page = $this->getSession()->getPage(); $assert_session = $this->assertSession(); + $this->click('#edit-group-description'); $autocomplete_field = $assert_session->waitForElement('css', '[name="' . $field_name . '[0][target_id]"].ui-autocomplete-input'); $autocomplete_field->setValue('Page'); $this->getSession()->getDriver()->keyDown($autocomplete_field->getXpath(), ' '); @@ -105,6 +106,7 @@ public function testServicesEntityReferenceAutocompleteWidget() { $page = $this->getSession()->getPage(); $assert_session = $this->assertSession(); + $this->click('#edit-group-description'); $autocomplete_field = $assert_session->waitForElement('css', '[name="' . $field_name . '[0][target_id]"].ui-autocomplete-input'); $autocomplete_field->setValue('Page'); $this->getSession()->getDriver()->keyDown($autocomplete_field->getXpath(), ' '); diff --git a/modules/localgov_services_navigation/tests/src/FunctionalJavascript/LandingPageChildrenTest.php b/modules/localgov_services_navigation/tests/src/FunctionalJavascript/LandingPageChildrenTest.php index 818acdc..b9d4f02 100644 --- a/modules/localgov_services_navigation/tests/src/FunctionalJavascript/LandingPageChildrenTest.php +++ b/modules/localgov_services_navigation/tests/src/FunctionalJavascript/LandingPageChildrenTest.php @@ -124,11 +124,12 @@ public function testServiceLandingPageLink() { $this->assertStringContainsString('child "> &one\' <"', $element->getHtml()); // Drag the child to a Tasks Link field. - $this->clickLink('Top tasks'); + $this->click('#edit-group-common-tasks'); $drag = $page->find('css', '#localgov-child-drag-' . $child[1]->id()); $target = $page->find('css', '#edit-localgov-common-tasks-0-uri'); $drag->dragTo($target); // Check it got populated. + sleep(2); $assert_session->fieldValueEquals('edit-localgov-common-tasks-0-uri', $child[1]->toUrl()->toString()); $assert_session->fieldValueEquals('edit-localgov-common-tasks-0-title', 'child "> &one\' <"'); @@ -204,7 +205,7 @@ public function testServiceLandingPageReference() { $assert_session->pageTextNotContains('status update listed on page elsewhere automatically'); // Drag the child to a Tasks Link field. - $this->clickLink('Child pages'); + $this->click('#edit-group-destinations'); $drag = $page->find('css', '#localgov-child-drag-' . $child[3]->id()); $target = $page->find('css', '#edit-localgov-destinations-0-target-id'); $drag->dragTo($target); diff --git a/modules/localgov_services_page/config/install/core.entity_form_display.node.localgov_services_page.default.yml b/modules/localgov_services_page/config/install/core.entity_form_display.node.localgov_services_page.default.yml index 23cb84f..3d48db7 100644 --- a/modules/localgov_services_page/config/install/core.entity_form_display.node.localgov_services_page.default.yml +++ b/modules/localgov_services_page/config/install/core.entity_form_display.node.localgov_services_page.default.yml @@ -84,6 +84,7 @@ third_party_settings: classes: '' id: '' direction: vertical + width_breakpoint: 1138 id: node.localgov_services_page.default targetEntityType: node bundle: localgov_services_page diff --git a/modules/localgov_services_sublanding/config/install/core.entity_form_display.node.localgov_services_sublanding.default.yml b/modules/localgov_services_sublanding/config/install/core.entity_form_display.node.localgov_services_sublanding.default.yml index 10f9dfb..f80edb8 100644 --- a/modules/localgov_services_sublanding/config/install/core.entity_form_display.node.localgov_services_sublanding.default.yml +++ b/modules/localgov_services_sublanding/config/install/core.entity_form_display.node.localgov_services_sublanding.default.yml @@ -27,6 +27,7 @@ third_party_settings: classes: '' id: '' direction: vertical + width_breakpoint: 1138 group_description: children: - localgov_services_parent