Skip to content

Commit

Permalink
Add a workaround for project being reconfigured as php project type (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
justafish authored Apr 3, 2024
1 parent 0491f95 commit 1f28b95
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
64 changes: 64 additions & 0 deletions .github/workflows/TestDDEV.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test DDEV Integration
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
Test-DDEV-Install:
runs-on: ubuntu-22.04
steps:
- name: Create a Drupal project
run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd

- uses: actions/checkout@v4
with:
path: drainpipe

- name: Setup drainpipe-dev
run: mv drainpipe/drainpipe-dev .

- uses: ./drainpipe/scaffold/github/actions/common/set-env

- name: Install DDEV
uses: ./drainpipe/scaffold/github/actions/common/ddev
with:
git-name: Drainpipe Bot
git-email: [email protected]

- name: Setup Project
run: |
ddev config --auto
ddev config --nodejs-version "18"
ddev start
ddev composer config extra.drupal-scaffold.gitignore true
ddev composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]'
ddev composer config --no-plugins allow-plugins.composer/installers true
ddev composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true
ddev composer config --no-plugins allow-plugins.lullabot/drainpipe true
ddev composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true
ddev composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}'
ddev composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}'
ddev composer config minimum-stability dev
ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies
ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies
- name: Reset Project
run: |
ddev stop --remove-data --omit-snapshot
rm -rf web/core vendor/ web/sites/default/settings.ddev.php
- name: Install DDEV
uses: ./drainpipe/scaffold/github/actions/common/ddev
with:
git-name: Drainpipe Bot
git-email: [email protected]

- name: Test DDEV Settings Generated
run: test -f web/sites/default/settings.ddev.php
7 changes: 6 additions & 1 deletion scaffold/github/actions/common/ddev/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ runs:
if [ "${{ inputs.composer-cache-dir }}" != "" ]; then
CACHE_DIR="${{ inputs.composer-cache-dir }}"
fi
ddev config --web-environment-add="COMPOSER_CACHE_DIR=/var/www/html/$CACHE_DIR"
# Workaround for https://github.com/ddev/ddev/issues/6044
if yq -re .type .ddev/config.yaml; then
ddev config --web-environment-add="COMPOSER_CACHE_DIR=/var/www/html/$CACHE_DIR" --project-type="$(yq -re .type .ddev/config.yaml)"
else
ddev config --web-environment-add="COMPOSER_CACHE_DIR=/var/www/html/$CACHE_DIR"
fi
fi
ddev start
Expand Down

0 comments on commit 1f28b95

Please sign in to comment.