Features #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |