-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (53 loc) · 1.88 KB
/
visual.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
59
60
61
on:
pull_request:
push:
branches:
- main
env:
SIMPLETEST_DB: mysql://drupal:drupal@db:3306/drupal
name: Visual regression tests
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set variables
run: echo "DRUPAL_ROOT=$HOME/drupal" >> $GITHUB_ENV
- name: Parse $THEME_NAME from composer.json
run: echo "THEME_NAME=$(cat composer.json | jq -r .name | awk -F/ '{print $NF}')" >> $GITHUB_ENV
- name: Clone platform
run: git clone https://github.com/City-of-Helsinki/drupal-helfi-platform.git $DRUPAL_ROOT
- name: Install and start Stonehenge
run: |
git clone -b 4.x https://github.com/druidfi/stonehenge.git ~/stonehenge
cd ~/stonehenge && make up
- name: Build project
working-directory: ${{ env.DRUPAL_ROOT }}
run: |
composer config repositories.5 path $GITHUB_WORKSPACE
composer require drupal/$THEME_NAME -W
- name: Start project
working-directory: ${{ env.DRUPAL_ROOT }}
run: |
docker compose up -d --wait
counter=0
until [ $counter -gt 5 ]
do
if docker compose exec app bash -c "\$(drush sql:connect) -e '\q'"; then
break
fi
((counter++))
sleep 2
done
- name: Setup Drupal
working-directory: ${{ env.DRUPAL_ROOT }}
run: |
mkdir public/sites/default/files -p && chmod 777 public/sites/default -R
docker compose exec app bash -c "ls -la public/themes/contrib/hdbt"
docker compose exec app bash -c "drush si minimal -y"
docker compose exec app bash -c "drush en helfi_test_content -y"
- name: Run tests
working-directory: ${{ env.DRUPAL_ROOT }}
run: curl https://mysite.docker.so