Skip to content

Commit 34dede1

Browse files
Behat: Install EasyEngine by default
- Let's not do it in the behat test - Install Latest ee (Develop Branch) and test changes against it. - Use latest docker and docker compose - Use composer chache in github actions - Remove unnecessary packages Signed-off-by: Immanuel Raj <[email protected]>
1 parent f4744dd commit 34dede1

File tree

3 files changed

+45
-20
lines changed

3 files changed

+45
-20
lines changed

.github/workflows/behat.yml

+44-2
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,52 @@ jobs:
2828
tools: composer
2929
extensions: pcntl, curl, sqlite3, zip, dom, mbstring, json, xml
3030

31+
- name: Get Composer cache directory
32+
id: composer-cache
33+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
34+
35+
- name: Set up Composer caching
36+
uses: actions/cache@v4
37+
env:
38+
cache-name: cache-composer-dependencies
39+
with:
40+
path: ${{ steps.composer-cache.outputs.dir }}
41+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
42+
restore-keys: |
43+
${{ runner.os }}-composer-
44+
45+
- name: Update docker
46+
run: |
47+
sudo apt remove --purge nginx nginx-common docker docker-engine docker.io docker-ce containerd runc
48+
curl -fsSL https://get.docker.com/ | sudo bash
49+
sudo systemctl restart docker.service
50+
51+
- name: Install docker-compose
52+
run: |
53+
VERSION=$(curl --silent "https://api.github.com./repos/docker/compose/releases/latest" |
54+
grep '"tag_name":' |
55+
sed -E 's/.*"([^"]+)".*/\1/'
56+
)
57+
sudo curl -L "https://github.com./docker/compose/releases/download/$VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
58+
3159
- name: Install dependencies
3260
run: |
33-
composer install --prefer-dist --no-progress --no-interaction
61+
cd "$GITHUB_WORKSPACE/.."
62+
git clone https://github.com./EasyEngine/easyengine.git easyengine --depth=1
63+
cd easyengine
64+
rm -rf features
65+
cp -R $GITHUB_WORKSPACE/features .
66+
sed -i 's/\(easyengine\/.*\):\ \".*\"/\1:\ \"dev-develop\"/' composer.json
67+
composer update --prefer-dist --no-progress --no-interaction --no-dev
68+
php -dphar.readonly=0 utils/make-phar.php easyengine.phar
69+
sudo cp easyengine.phar /usr/local/bin/ee
70+
composer update --prefer-dist --no-progress --no-interaction --no-plugins
3471
3572
- name: Test
73+
shell: 'script -q -e -c "bash {0}"'
3674
run: |
37-
sudo -E ./vendor/bin/behat
75+
set -e
76+
cd "$GITHUB_WORKSPACE/../easyengine"
77+
sudo -E ./vendor/bin/behat
78+
env:
79+
COMPOSE_INTERACTIVE_NO_CLI: 1

features/admintools.feature

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Feature: EasyEngine Admin Tools
22

33
Scenario: Enable and disable admin tools with EasyEngine
4-
Given I have installed EasyEngine if not installed
5-
And I have created a WordPress site at "example.com"
4+
I have created a WordPress site at "example.com"
65
When I run "ee admin-tools enable example.com"
76
Then I should be able to access "http://example.com/ee-admin/"
87
When I run "ee admin-tools disable example.com"

features/bootstrap/FeatureContext.php

-16
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,8 @@
66
class FeatureContext implements Context, SnippetAcceptingContext
77
{
88
private $command_output;
9-
private static $easyengine_installed = false;
109
private static $site_created = false;
1110

12-
/**
13-
* @Given I have installed EasyEngine if not installed
14-
*/
15-
public function iHaveInstalledEasyengineIfNotInstalled()
16-
{
17-
if (!self::$easyengine_installed) {
18-
$install_command = 'wget -qO ee https://rt.cx/ee4 && sudo bash ee && sudo rm ee';
19-
$install_output = shell_exec($install_command);
20-
if (!file_exists('/usr/local/bin/ee')) {
21-
throw new Exception("EasyEngine could not be installed.");
22-
}
23-
self::$easyengine_installed = true;
24-
}
25-
}
26-
2711
/**
2812
* @Given I have created a WordPress site at :site
2913
*/

0 commit comments

Comments
 (0)