-
Notifications
You must be signed in to change notification settings - Fork 14
117 lines (100 loc) · 4.65 KB
/
TestTugboat.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: "Test Tugboat"
on:
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
Test-Tugboat:
runs-on: ubuntu-22.04
steps:
- name: Create a Drupal project
run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd
- uses: actions/checkout@v4
with:
path: drainpipe
- uses: ./drainpipe/scaffold/github/actions/common/set-env
- name: Install DDEV
uses: ./drainpipe/scaffold/github/actions/common/ddev
with:
git-name: Drainpipe Bot
git-email: no-reply@example.com
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Setup Project
run: |
ddev config --auto
ddev config --php-version "8.1"
ddev config --nodejs-version "18"
ddev config --database=mariadb:10.4
ddev start
ddev composer config extra.drupal-scaffold.gitignore true
ddev composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"]
ddev composer config --no-plugins allow-plugins.composer/installers true
ddev composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true
ddev composer config --no-plugins allow-plugins.lullabot/drainpipe true
ddev composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}'
ddev composer config minimum-stability dev
ddev composer config extra.drainpipe --json '{"tugboat": {}}'
ddev composer require lullabot/drainpipe --with-all-dependencies
# Compare the generated files to the ones used to build this repository
# preview - they should be the same.
- name: Test Generated Files
run: |
cmp -b drainpipe/.tugboat/config.yml .tugboat/config.yml
sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/1-init.sh
sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/2-update.sh
sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/3-build.sh
cmp -b drainpipe/.tugboat/steps/1-init.sh .tugboat/steps/1-init.sh
cmp -b drainpipe/.tugboat/steps/2-update.sh .tugboat/steps/2-update.sh
cmp -b drainpipe/.tugboat/steps/3-build.sh .tugboat/steps/3-build.sh
- name: Add a build:tugboat step
run: |
echo " build:tugboat:" >> Taskfile.yml
echo " cmds:" >> Taskfile.yml
echo " - echo \"Tugboat build\"" >> Taskfile.yml
ddev composer install
if ! grep -q './vendor/bin/task build:tugboat' .tugboat/steps/3-build.sh; then
exit 1
fi
- name: Upload test artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: .tugboat
path: .tugboat
Test-Non-Default-Nodejs:
runs-on: ubuntu-22.04
steps:
- name: Create a Drupal project
run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd
- uses: actions/checkout@v4
with:
path: drainpipe
- uses: ./drainpipe/scaffold/github/actions/common/set-env
- name: Install DDEV
uses: ./drainpipe/scaffold/github/actions/common/ddev
with:
git-name: Drainpipe Bot
git-email: no-reply@example.com
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Setup Project
run: |
ddev config --auto
ddev config --php-version "8.1"
ddev config --nodejs-version "16"
ddev config --database=mariadb:10.4
ddev start
ddev composer config extra.drupal-scaffold.gitignore true
ddev composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"]
ddev composer config --no-plugins allow-plugins.composer/installers true
ddev composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true
ddev composer config --no-plugins allow-plugins.lullabot/drainpipe true
ddev composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}'
ddev composer config minimum-stability dev
ddev composer config extra.drainpipe --json '{"tugboat": {}}'
ddev composer require lullabot/drainpipe --with-all-dependencies
- name: Test NODE_MAJOR is correct
run: |
cat .tugboat/steps/1-init.sh
grep -q NODE_MAJOR=16 .tugboat/steps/1-init.sh