This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
Fix new debugging output in GitHub Actions DDEV workflow. #1
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
name: Main | |
on: | |
push: | |
branches: [ main, wip ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
# Every twelve (12) hours. | |
# @see https://crontab.guru/every-12-hours | |
- cron: 0 */12 * * * | |
workflow_dispatch: | |
jobs: | |
ubuntu: | |
runs-on: ubuntu-latest | |
container: | |
image: tugboatqa/php:8.3-apache | |
volumes: | |
- ${{ github.workspace }}:/var/lib/tugboat | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu ] | |
php: [ 8.1, 8.2, 8.3 ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout | |
- name: Configure image | |
run: | | |
git config --global --add safe.directory /__w/starshot-prototype/starshot-prototype | |
docker-php-ext-install opcache | |
a2enmod headers rewrite | |
echo "memory_limit = -1" >> /usr/local/etc/php/conf.d/my-php.ini | |
sudo service apache2 start | |
- name: Create project | |
run: | | |
set -o xtrace | |
sudo apt update | |
sudo apt install sqlite3 | |
# Prepare the target directory. | |
sudo mkdir -p /var/www | |
sudo rm -rf /var/www/* | |
sudo chmod 777 /var/www | |
# Create the project. | |
git branch -f main || true | |
git checkout main | |
composer create-project \ | |
--stability=dev \ | |
--repository='{"type":"vcs","url":"'"$(pwd)"'"}' \ | |
--ansi \ | |
drupal/starshot-project \ | |
/var/www | |
cd /var/www | |
# @todo For some reason the Drush "config:set" command run by composer | |
# create-project to enable verbose logging doesn't ultimately take | |
# effect. Manually change the settings until it can be debugged. | |
echo "if (file_exists(__DIR__ . '/settings.local.php')) { | |
include __DIR__ . '/settings.local.php'; | |
}" | sudo tee -a web/sites/default/settings.php | |
sudo cp web/sites/example.settings.local.php \ | |
web/sites/default/settings.local.php | |
# Make everything writable. | |
sudo chmod -R 777 /var/www/web | |
# Symlink docroot. | |
ln -snf /var/www/web "${DOCROOT}" | |
# Run cron to populate the search index, etc. | |
php ./vendor/bin/drush core:cron | |
- name: Debugging | |
run: | | |
set -o xtrace | |
# Current commit. | |
git log -s -1 | head -2 | |
# PHP version. | |
php -v || head -1 | |
# Drush status. | |
php /var/www/vendor/bin/drush core:status || true | |
# Apache smoke tests. | |
curl --silent http://localhost/ | grep "<title>" || true | |
curl --location --silent http://localhost/node/1 | grep "<title>" || true | |
- name: Test | |
working-directory: /var/www | |
run: composer drupal:run-tests -- --testdox |