-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10fafaf
commit 581274b
Showing
4 changed files
with
75 additions
and
25 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: E2E Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: NPM Install | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use desired version of NodeJS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Start env | ||
run: npm run env:start | ||
|
||
- name: ping localhost | ||
run: curl -I http://localhost | ||
|
||
- name: ping subdir | ||
run: curl -I http://localhost/second |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# BEGIN WordPress | ||
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are | ||
# dynamically generated, and should only be modified via WordPress filters. | ||
# Any changes to the directives between these markers will be overwritten. | ||
RewriteEngine On | ||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | ||
RewriteBase / | ||
RewriteRule ^index\.php$ - [L] | ||
|
||
# add a trailing slash to /wp-admin | ||
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] | ||
|
||
RewriteCond %{REQUEST_FILENAME} -f [OR] | ||
RewriteCond %{REQUEST_FILENAME} -d | ||
RewriteRule ^ - [L] | ||
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] | ||
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] | ||
RewriteRule . index.php [L] | ||
|
||
# END WordPress |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
#!/bin/bash | ||
set -e | ||
# set -e | ||
|
||
npm run env run tests-wordpress "chmod -c ugo+w /var/www/html" | ||
npm run env run tests-cli "wp rewrite structure '/%postname%/' --hard" | ||
# npm run env run tests-wordpress "chmod -c ugo+w /var/www/html" | ||
# npm run env run tests-cli "wp rewrite structure '/%postname%/' --hard" | ||
|
||
status=0 | ||
npm run env run tests-cli "wp site list" || status=$? | ||
# status=0 | ||
# npm run env run tests-cli "wp site list" || status=$? | ||
|
||
if [ $status -eq 0 ] | ||
then | ||
echo "Multisite already initialized" | ||
else | ||
echo "Converting to multisite" | ||
npm run env run tests-cli "wp core multisite-convert --title='Distributor Multisite'" | ||
npm run env run tests-cli "wp user create second '[email protected]' --user_pass=password --role=administrator" | ||
npm run env run tests-cli "wp site create --slug=second --title='Second Site' --email='[email protected]'" | ||
npm run env run tests-cli "wp theme enable twentytwentyone --activate" | ||
npm run env run tests-cli "wp theme enable twentytwentyone --url=localhost/second --activate" | ||
npm run env run tests-cli "cp wp-content/plugins/distributor/tests/cypress/.htaccess .htaccess" | ||
fi | ||
# if [ $status -eq 0 ] | ||
# then | ||
# echo "Multisite already initialized" | ||
# else | ||
# echo "Converting to multisite" | ||
# npm run env run tests-cli "wp core multisite-convert --title='Distributor Multisite'" | ||
# npm run env run tests-cli "wp user create second '[email protected]' --user_pass=password --role=administrator" | ||
# npm run env run tests-cli "wp site create --slug=second --title='Second Site' --email='[email protected]'" | ||
# npm run env run tests-cli "wp theme enable twentytwentyone --activate" | ||
# npm run env run tests-cli "wp theme enable twentytwentyone --url=localhost/second --activate" | ||
# npm run env run tests-cli "cp wp-content/plugins/distributor/tests/cypress/.htaccess .htaccess" | ||
# fi | ||
|
||
wp-env run cli wp core multisite-convert | ||
HTACCESS_PATH="$(wp-env install-path)/WordPress/.htaccess" | ||
cp ./tests/bin/.htaccess $HTACCESS_PATH; | ||
wp-env run cli wp user create second '[email protected]' --user_pass=password --role=administrator | ||
wp-env run cli wp site create --slug=second --title='Second Site' --email='[email protected]' |