Skip to content

Commit

Permalink
Fix drush install
Browse files Browse the repository at this point in the history
* Fix drush install

* Match the DRUPAL_TESTING_COMPOSER_PROJECT_VERSION to DRUPAL_TESTING_DRUPAL_VERSION by default

---------

Co-authored-by: Alex Pott <[email protected]>
Co-authored-by: Christian Fritsch <[email protected]>
Co-authored-by: alexpott <[email protected]>
  • Loading branch information
4 people authored Jan 17, 2024
1 parent 07485ce commit 9ca4b13
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ jobs:
- RUN: 3
DRUPAL_TESTING_COMPOSER_PROJECT: 'thunder/thunder-project'
DRUPAL_TESTING_DRUPAL_VERSION: '~9.4.0'
DRUPAL_TESTING_COMPOSER_PROJECT_VERSION: '3.0.12'
PHP_VERSION: '7.4'
- RUN: 4
DRUPAL_TESTING_DRUPAL_VERSION: '~9.4'
PHP_VERSION: '8.0'
- RUN: 5
DRUPAL_TESTING_DRUPAL_VERSION: '~10.0'
PHP_VERSION: '8.1'
- RUN: 6
PHP_VERSION: '8.2'

steps:
- uses: actions/checkout@v1
Expand Down Expand Up @@ -75,6 +78,7 @@ jobs:
DRUPAL_TESTING_COMPOSER_PROJECT: ${{ matrix.DRUPAL_TESTING_COMPOSER_PROJECT }}
DRUPAL_TESTING_DRUPAL_VERSION: ${{ matrix.DRUPAL_TESTING_DRUPAL_VERSION }}
DRUPAL_TESTING_MIN_BUILD: ${{ matrix.DRUPAL_TESTING_MIN_BUILD }}
DRUPAL_TESTING_COMPOSER_PROJECT_VERSION: ${{ matrix.DRUPAL_TESTING_COMPOSER_PROJECT_VERSION }}

test-split-upload:
runs-on: ubuntu-latest
Expand Down
10 changes: 5 additions & 5 deletions configuration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ DRUPAL_TESTING_VERBOSE=${DRUPAL_TESTING_VERBOSE:-false}
# The composer project to use. defaults to the drupal/recommended-project. But e.g. Distribution specific projects can be used instead.
DRUPAL_TESTING_COMPOSER_PROJECT=${DRUPAL_TESTING_COMPOSER_PROJECT:-"drupal/recommended-project"}

# The drupal version to test against. This can be any valid composer version string, but only drupal versions greater 8.6
# are supported. By default, we use the most recent stable version.
DRUPAL_TESTING_DRUPAL_VERSION=${DRUPAL_TESTING_DRUPAL_VERSION:-$(git ls-remote --tags --sort=-version:refname https://github.com/drupal/core.git | grep -E -o '[0-9]+\.[0-9]\.[0-9]+$' | head -n1)}

# The version of the composer project to use.
DRUPAL_TESTING_COMPOSER_PROJECT_VERSION=${DRUPAL_TESTING_COMPOSER_PROJECT_VERSION:-"*"}
DRUPAL_TESTING_COMPOSER_PROJECT_VERSION=${DRUPAL_TESTING_COMPOSER_PROJECT_VERSION:-${DRUPAL_TESTING_DRUPAL_VERSION}}

# The directory, where the project is located. On travis this is set to TRAVIS_BUILD_DIR otherwise defaults to the current directory
DRUPAL_TESTING_PROJECT_BASEDIR=${DRUPAL_TESTING_PROJECT_BASEDIR:-${TRAVIS_BUILD_DIR:-$(pwd)}}
Expand Down Expand Up @@ -77,10 +81,6 @@ DRUPAL_TESTING_TEST_DEPRECATION=${DRUPAL_TESTING_TEST_DEPRECATION:-test -f phpst
# The files pattern to ignore when testing php coding styles.
DRUPAL_TESTING_PHPCS_IGNORE_PATTERN=${DRUPAL_TESTING_PHPCS_IGNORE_PATTERN:-*/vendor/*,*/core/*,*/autoload.php,*.md}

# The drupal version to test against. This can be any valid composer version string, but only drupal versions greater 8.6
# are supported. By default, we use the most recent stable version.
DRUPAL_TESTING_DRUPAL_VERSION=${DRUPAL_TESTING_DRUPAL_VERSION:-$(git ls-remote --tags --sort=-version:refname https://github.com/drupal/core.git | grep -E -o '[0-9]+\.[0-9]\.[0-9]+$' | head -n1)}

# The base directory for all generated files. Into this diretory will be drupal installed and temp files stored.
# This directory gets removed after successful tests.
DRUPAL_TESTING_TEST_BASE_DIRECTORY=${DRUPAL_TESTING_TEST_BASE_DIRECTORY:-/tmp/test/${DRUPAL_TESTING_PROJECT_NAME}}
Expand Down
3 changes: 2 additions & 1 deletion lib/stages/prepare_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ _stage_prepare_build() {
composer require oomphinc/composer-installers-extender --no-update --working-dir="${DRUPAL_TESTING_DRUPAL_INSTALLATION_DIRECTORY}"
fi

composer require drush/drush:"^11.2.0" --no-update --working-dir="${DRUPAL_TESTING_DRUPAL_INSTALLATION_DIRECTORY}"
composer require phpspec/prophecy-phpunit:^2 --dev --no-update --working-dir="${DRUPAL_TESTING_DRUPAL_INSTALLATION_DIRECTORY}"

# Require phpstan.
Expand Down Expand Up @@ -67,6 +66,8 @@ _stage_prepare_build() {
composer require "${dev_dependency}" --dev --no-update --working-dir="${DRUPAL_TESTING_DRUPAL_INSTALLATION_DIRECTORY}"
done

composer require drush/drush --no-install --working-dir="${DRUPAL_TESTING_DRUPAL_INSTALLATION_DIRECTORY}"

# Allow required plugins
composer config allow-plugins.cweagans/composer-patches true --no-plugins --working-dir="${DRUPAL_TESTING_DRUPAL_INSTALLATION_DIRECTORY}"
composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins --working-dir="${DRUPAL_TESTING_DRUPAL_INSTALLATION_DIRECTORY}"
Expand Down

0 comments on commit 9ca4b13

Please sign in to comment.