forked from drupal-composer/drupal-project
-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (58 loc) · 2.3 KB
/
test-drupal-setup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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"