diff --git a/.github/workflows/drupal-contrib-integration-test.yml b/.github/workflows/drupal-contrib-integration-test.yml index b7f97c0..a696585 100644 --- a/.github/workflows/drupal-contrib-integration-test.yml +++ b/.github/workflows/drupal-contrib-integration-test.yml @@ -7,7 +7,7 @@ name: Drupal Contrib Integration Tests # contrib-plain — matrix of known modules on D11, runs on every # push to main and nightly # contrib-issue-fork — single workspace using a real drupal.org contrib issue -# fork, runs nightly only +# fork, runs on every push to main, PRs, and nightly # # Repository variables (optional, set in GitHub → Settings → Variables): # CONTRIB_TEST_PROJECT - Module machine name for issue fork test (default: token) @@ -204,10 +204,7 @@ jobs: contrib-issue-fork: name: Contrib ${{ vars.CONTRIB_TEST_PROJECT || 'token' }} issue fork - if: | - vars.CONTRIB_TEST_ISSUE_FORK != '' && - github.event_name != 'push' && - (github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner) + if: ${{ vars.CONTRIB_TEST_ISSUE_FORK != '' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner) }} runs-on: [self-hosted, sysbox] defaults: run: diff --git a/.github/workflows/drupal-integration-test.yml b/.github/workflows/drupal-integration-test.yml index 8bdd3f2..9e469ba 100644 --- a/.github/workflows/drupal-integration-test.yml +++ b/.github/workflows/drupal-integration-test.yml @@ -7,7 +7,7 @@ name: Drupal Integration Tests # drupal-plain — matrix of D11 and D12, no issue fork, runs on every # push to main and nightly # drupal-issue-fork — single workspace using a real drupal.org issue fork, -# runs nightly only +# runs on every push to main, PRs, and nightly # # Repository variable: # DRUPAL_TEST_ISSUE_FORK - drupal.org issue number (bare, e.g. 3585397) or @@ -195,9 +195,7 @@ jobs: drupal-issue-fork: name: Drupal issue fork ${{ vars.DRUPAL_TEST_ISSUE_FORK || '3585397' }} - if: | - github.event_name != 'push' && - (github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner) + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }} runs-on: [self-hosted, sysbox] defaults: run: diff --git a/drupal-contrib/template.tf b/drupal-contrib/template.tf index 8f12f09..dbf0ce1 100644 --- a/drupal-contrib/template.tf +++ b/drupal-contrib/template.tf @@ -684,10 +684,30 @@ COMPOSE_EOF fi if [ "$SETUP_FAILED" = "false" ]; then - # Restart triggers ddev symlink-project automatically + # Restart triggers ddev symlink-project automatically. + # symlink-project creates web/modules/custom/ -> project root. + # Without this symlink drush cannot discover the module. log_setup "Restarting DDEV to trigger symlink-project..." - ddev restart >> "$SETUP_LOG" 2>&1 || true + update_status "⏳ DDEV restart: In progress..." + if ddev restart >> "$SETUP_LOG" 2>&1; then + log_setup "✓ DDEV restarted" + update_status "✓ DDEV restart: Success" + else + log_setup "✗ DDEV restart failed — trying stop + start..." + update_status "⚠ DDEV restart: Retrying..." + ddev stop >> "$SETUP_LOG" 2>&1 || true + if ddev start >> "$SETUP_LOG" 2>&1; then + log_setup "✓ DDEV started (after restart failure)" + update_status "✓ DDEV restart: Success (via stop+start)" + else + log_setup "✗ DDEV start failed after restart failure" + update_status "✗ DDEV restart: Failed" + SETUP_FAILED=true + fi + fi + fi + if [ "$SETUP_FAILED" = "false" ]; then # Install Drupal INSTALL_PROFILE="${data.coder_parameter.install_profile.value}" log_setup "Installing Drupal ($INSTALL_PROFILE profile)..." @@ -717,8 +737,9 @@ COMPOSE_EOF log_setup "✓ $PROJECT_NAME enabled" update_status "✓ $PROJECT_NAME: Enabled" else - log_setup "⚠ Warning: $PROJECT_NAME not found in enabled modules list" - update_status "⚠ $PROJECT_NAME: Not enabled (check /tmp/drupal-setup.log)" + log_setup "✗ $PROJECT_NAME not found in enabled modules — enable failed" + update_status "✗ $PROJECT_NAME: Not enabled (check /tmp/drupal-setup.log)" + SETUP_FAILED=true fi fi fi