-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (103 loc) · 4.55 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
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 4.3
runs-on: ubuntu-20.04
services:
elggdb:
image: 'mysql:8.0'
env:
MYSQL_DATABASE: elgg
MYSQL_ROOT_PASSWORD: password
ports:
- 3306:3306
steps:
- name: Install 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 Elgg 4.3
uses: actions/checkout@v3
with:
repository: 'Elgg/Elgg'
ref: '4.3'
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> ${GITHUB_OUTPUT}
- name: Restore Composer Cache for 4.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 Elgg 4.3 dependencies
run: composer install
- name: Elgg CLI install Elgg 4.3
run: php ./elgg-cli install --config ./install/cli/testing_app.php --verbose --no-ansi
- name: Enable Elgg 4.3 plugins
run: php -f ./.scripts/ci/enable_plugins.php
- name: Seed Elgg 4.3 database
run: php ./elgg-cli database:seed --limit=5 --image_folder=./.scripts/seeder/images/ -vv --no-ansi
- name: Code checkout Elgg 5.1
uses: actions/checkout@v3
with:
repository: 'Elgg/Elgg'
ref: '5.1'
clean: false
- name: Composer install Elgg 5.1 dependencies
run: composer install --prefer-dist --no-suggest
- name: Elgg CLI upgrade to 5.1
run: php ./elgg-cli upgrade async --verbose
- name: Enable Elgg 5.1 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: Update PHP to 8.1
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
extensions: gd,pdo,xml,json,mysqli,pdo_mysql,libxml,mbstring
ini-values: zend.enable_gc=0
- 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: 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 generic
run: ./vendor/bin/phpunit --testsuite plugins-integration-generic
- 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