Skip to content

chore: LDP-2635: Use docker compose instead of docker-compose. #88

chore: LDP-2635: Use docker compose instead of docker-compose.

chore: LDP-2635: Use docker compose instead of docker-compose. #88

name: Test drupal setup
on:
repository_dispatch:
workflow_dispatch:
push:
branches:
- '6.**'
pull_request:
types: [opened, reopened, edited]
jobs:
test-drupal-setup:
name: Build and install drupal project
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Setup PHP
run: |
sudo update-alternatives --set php /usr/bin/php8.1
- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
- name: "Cache dependencies installed with composer"
uses: actions/[email protected]
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: ${{ runner.os }}-composer-v1-${{ hashFiles('./composer.json') }}
restore-keys: |
${{ runner.os }}-composer-v1
- name: Install docker compose.
run: |
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker compose version
- name: Install composer dependencies.
run: |
composer config platform-check false
composer config --no-plugins allow-plugins.phpstan/extension-installer true
composer create-project
composer install
- name: Setup the environment
run: |
vendor/bin/phapp setup localdev
- name: Setup docker containers
shell: 'script -q -e -c "bash {0}"'
run: |
export COMPOSE_DEFAULT_USER=$(id -u $USER)
docker-compose up -d
echo "Waiting for mysql to come up..." && docker exec -it $(docker compose ps -q cli) /bin/bash -c "while ! echo exit | nc mariadb 3306; do sleep 1; done" >/dev/null
- name: Install the project
shell: 'script -q -e -c "bash {0}"'
run: |
docker compose exec cli phapp install --no-build
- name: Check connection and response of the site
run: |
curl -v http://example.drupal-project.localdev.space | grep "Drupal 10"