-
Notifications
You must be signed in to change notification settings - Fork 0
161 lines (130 loc) · 5.3 KB
/
upgrade.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Elgg upgrade
on: [pull_request]
env:
ELGG_DB_PREFIX: c_i_elgg_
ELGG_DB_HOST: 127.0.0.1
ELGG_DB_NAME: elgg
ELGG_DB_USER: root
ELGG_DB_PASS: password
ELGG_WWWROOT: http://localhost:8888/
jobs:
upgrade:
name: Upgrade from 2.3
runs-on: ubuntu-20.04
services:
elggdb:
image: mysql:5.7
env:
MYSQL_DATABASE: elgg
MYSQL_ROOT_PASSWORD: password
ports:
- 3306:3306
steps:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
extensions: gd,pdo,xml,json,mysqli,pdo_mysql,libxml,mbstring
- name: Install Composer v1
run: composer self-update --1
- name: Code checkout Elgg 2.3
uses: actions/checkout@v3
with:
repository: 'Elgg/Elgg'
ref: '2.3'
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> ${GITHUB_OUTPUT}
- name: Restore Composer Cache for 2.3
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Composer install
run: |
composer global require fxp/composer-asset-plugin:^1.1.4 --prefer-dist
composer install
- name: Install Elgg 2.3
run: |
mkdir ${HOME}/elgg_data
php -f ./install/cli/ci_installer.php
- name: Enable Elgg 2.3 plugins
run: php -f ./.scripts/ci/enable_plugins.php
- name: Seed Elgg 2.3 database
run: php -f ./.scripts/seeder/seed.php
- name: Code checkout Elgg 3.3
uses: actions/checkout@v3
with:
repository: 'Elgg/Elgg'
ref: '3.3'
clean: false
- name: Composer install Elgg 3.3 dependencies
run: composer install --prefer-dist --no-suggest
- name: Elgg CLI upgrade to 3.3
run: php ./elgg-cli upgrade async --verbose
- name: Enable Elgg 3.3 plugins
run: php -f ./.scripts/ci/enable_plugins.php
- name: Install Composer v2
# make sure to remove the global fxp/composer-asset-plugin package as it's no longer needed
# also remove the elgg/login_as plugin because after the Composer update it has a hard time removing it
run: |
composer global remove fxp/composer-asset-plugin
composer remove elgg/login_as
composer self-update --2
- name: Code checkout Elgg 4.3
uses: actions/checkout@v3
with:
repository: 'Elgg/Elgg'
ref: '4.3'
clean: false
- name: Composer install Elgg 4.3 dependencies
run: composer install --prefer-dist --no-suggest
- name: Elgg CLI upgrade to 4.3
run: php ./elgg-cli upgrade async --verbose
- name: Enable Elgg 4.3 plugins
run: php -f ./.scripts/ci/enable_plugins.php
- name: Update PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
coverage: none
extensions: gd,pdo,xml,json,mysqli,pdo_mysql,libxml,mbstring
- name: Code checkout PR
uses: actions/checkout@v3
with:
clean: false
- name: Restore Composer Cache for PR
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Composer update
# using composer update to make sure we have latest dependencies like in the starter project (zip)
run: composer update --prefer-dist
- name: Elgg CLI upgrade
run: php ./elgg-cli upgrade async --verbose
- name: Activate current plugins
run: |
php ./elgg-cli plugins:activate activity blog bookmarks ckeditor dashboard developers discussions externalpages file friends friends_collections garbagecollector groups invitefriends likes members messageboard messages pages profile reportedcontent search site_notifications system_log tagcloud theme_sandbox thewire uservalidationbyemail web_services custom_index:last --no-ansi
php ./elgg-cli plugins:list --no-ansi
- name: Start Elgg webserver
run: |
php -S localhost:8888 -c ./.scripts/ci/local_php_server.ini index.php &
# give Web server some time to bind to sockets, etc
sleep 3
# check if the webserver is running
curl -s http://localhost:8888/ | tac | tac | grep -q "<title>Elgg CI Site</title>"
- name: Run PHPUnit - Core unit
run: ./vendor/bin/phpunit --testsuite unit
- name: Run PHPUnit - Core integration
run: ./vendor/bin/phpunit --testsuite integration
- name: Run PHPUnit - Plugins unit
run: ./vendor/bin/phpunit --testsuite plugins-unit
- name: Run PHPUnit - Plugins integration
run: ./vendor/bin/phpunit --testsuite plugins-integration
- name: Unseed Elgg database
if: ${{ always() }}
run: php ./elgg-cli database:unseed -vv