-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I'll be flabberghasted it this even runs...
- Loading branch information
1 parent
2d0ed7d
commit d561ea4
Showing
2 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Settings file to connect to a local mysql. | ||
* Copied into position on GitHub CI runs. | ||
*/ | ||
|
||
$databases['default']['default']['database'] = "db"; | ||
$databases['default']['default']['username'] = "user"; | ||
$databases['default']['default']['password'] = ""; | ||
$databases['default']['default']['host'] = "localhost"; | ||
$databases['default']['default']['port'] = "30123"; | ||
$databases['default']['default']['driver'] = "mysql"; | ||
|
||
|
||
// This will prevent Drupal from setting read-only permissions on sites/default. | ||
$settings['skip_permissions_hardening'] = TRUE; | ||
|
||
// This will ensure the site can only be accessed through the intended host | ||
// names. Additional host patterns can be added for custom configurations. | ||
$settings['trusted_host_patterns'] = ['.*']; | ||
|
||
// Don't use Symfony's APCLoader. ddev includes APCu; Composer's APCu loader has | ||
// better performance. | ||
$settings['class_loader_auto_detect'] = FALSE; | ||
|
||
// Set $settings['config_sync_directory'] if not set in settings.php. | ||
if (empty($settings['config_sync_directory'])) { | ||
$settings['config_sync_directory'] = 'sites/default/files/sync'; | ||
} | ||
|
||
// Enable verbose logging for errors. | ||
// https://www.drupal.org/forum/support/post-installation/2018-07-18/enable-drupal-8-backend-errorlogdebugging-mode | ||
$config['system.logging']['error_level'] = 'verbose'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Behaviour Tests | ||
on: [push] | ||
|
||
env: | ||
PLATFORMSH_CLI_TOKEN: ${{ secrets.PLATFORMSH_CLI_TOKEN }} | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP, with composer and extensions | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.2' | ||
extensions: gdate, dom, filter, gd, hash, json, pcre, PDO, session, SimpleXML, SPL, tokenizer, xml | ||
|
||
- name: Composer Install | ||
run: | | ||
composer --no-interaction --no-progress --optimize-autoloader install | ||
# Install Psh CLI. | ||
- name: Install Psh CLI | ||
run: curl -sS https://platform.sh/cli/installer | php | ||
|
||
# If you need to connect to database. | ||
- name: Load certificate | ||
run: ~/.platformsh/bin/platform ssh-cert:load -y -vvv | ||
|
||
- name: Add Psh to trusted keys | ||
run: | | ||
ssh-keyscan ssh.uk-1.platform.sh >> ~/.ssh/known_hosts | ||
ssh-keyscan git.uk-1.platform.sh >> ~/.ssh/known_hosts | ||
# Non-database Psh commands. | ||
- name: Spin up environment | ||
run: ~/.platformsh/bin/platform environment:activate -p XXX -e ${GITHUB_REF#refs/heads/} --yes | ||
|
||
- name: connect to psh PR db | ||
run: | | ||
nohup platform tunnel:single --project=nlw7xhb3fyt7y --environment=${GITHUB_REF#refs/heads/} --port=30123 --relationship=database --yes & > phpd.log 2>&1 & | ||
- name: Drupal config to access db | ||
run: | | ||
cp ./.github/snippets/settings.local.php ./web/sites/default/settings.local.php | ||
# Finally, run the tests. | ||
- name: Run Behat tests | ||
run: | | ||
./vendor/bin/behat | ||
- name: Tear it all down | ||
run: | | ||
platform tunnel:close --project=nlw7xhb3fyt7y --environment=${GITHUB_REF#refs/heads/} --yes |