-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #116: Test things without hackalicious * #116: Add php 8.0 tests * #116: Add php other php tests * #116: Scale back tests for a sec * #116: Scale back tests for a sec part 2 * #116: Scale tests back up * #116: Scale tests back up part 2 * #116: Scale tests back up part 3
- Loading branch information
Showing
92 changed files
with
1,808 additions
and
46 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,77 @@ | ||
name: PHP Tests | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
leia-tests: | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
TERM: xterm | ||
strategy: | ||
matrix: | ||
leia-tests: | ||
- examples/php-8.0 | ||
- examples/php-7.4 | ||
- examples/php-7.3 | ||
- examples/php-7.2 | ||
- examples/php-7.1 | ||
- examples/php-7.0 | ||
- examples/php-5.6 | ||
- examples/php-5.5 | ||
# - examples/php-5.4 | ||
lando-versions: | ||
- edge | ||
os: | ||
- ubuntu-20.04 | ||
node-version: | ||
- '14' | ||
|
||
steps: | ||
# Install deps and cache | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: yarn | ||
- name: Install Yarn dependencies | ||
run: yarn install --prefer-offline --frozen-lockfile | ||
|
||
# This block should eventually become use lando/actions-hyperdrive@v2 | ||
- name: Verify Docker dependencies | ||
run: | | ||
docker --version | grep "20.10." | ||
docker-compose --version | grep "1.29." | ||
- name: Grab latest edge Lando CLI | ||
run: | | ||
sudo curl -fsSL -o /usr/local/bin/lando "https://files.lando.dev/cli/lando-linux-x64-${{ matrix.lando-versions }}" | ||
sudo chmod +x /usr/local/bin/lando | ||
- name: Move in lando config appropriate for testing | ||
run: | | ||
mkdir -p ~/.lando/cache | ||
cp -f actions-lando-config.yml ~/.lando/config.yml | ||
echo false > ~/.lando/cache/report_errors | ||
lando --clear | ||
- name: Verify Lando works and we are dogfooding this plugin for tests | ||
run: | | ||
lando version | ||
lando config --path plugins | grep platformsh | grep /home/runner/work/platformsh/platformsh || echo "::error:: Not dogfooding this plugin correctly! " | ||
cd ${{ matrix.leia-tests }} | ||
lando config --path plugins | grep platformsh | grep dir | grep /home/runner/work/platformsh/platformsh || echo "::error:: Not dogfooding this plugin correctly! " | ||
# This block should eventually become use lando/actions-leia@v2 | ||
# @NOTE? Do we want a way for our leia-action to configure apparmor since | ||
# this might break a whole bunch of tests? or is this literally just a thing | ||
# for the platform.sh mysql/mariadb container? | ||
- name: Configure apparmor | ||
run: | | ||
set -x | ||
sudo apt-get remove mysql-server --purge | ||
sudo apt-get install apparmor-profiles | ||
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld | ||
- name: Run leia tests | ||
shell: bash | ||
run: yarn leia "./${{ matrix.leia-tests }}/README.md" -c 'Destroy tests' --stdin --shell bash | ||
|
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 @@ | ||
# Drupal editor configuration normalization | ||
# @see http://editorconfig.org/ | ||
|
||
# This is the top-most .editorconfig file; do not search in parent directories. | ||
root = true | ||
|
||
# All files. | ||
[*] | ||
end_of_line = LF | ||
indent_style = space | ||
indent_size = 4 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[composer.{json,lock}] | ||
indent_size = 4 | ||
|
||
[.platform.app.yaml] | ||
indent_size = 4 |
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,11 @@ | ||
vendor | ||
files | ||
data | ||
private | ||
.platform/local | ||
|
||
*.sql | ||
*.tar.gz | ||
*.tar | ||
|
||
.DS_Store |
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,10 @@ | ||
name: lando-platformsh-php-5.4 | ||
recipe: platformsh | ||
config: | ||
id: DISCONNECTED | ||
|
||
|
||
# This is important because it lets lando know to test against the plugin in this repo | ||
# DO NOT REMOVE THIS! | ||
plugins: | ||
"@lando/platformsh": ./../../ |
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,9 @@ | ||
name: vanilla | ||
type: "php:5.4" | ||
build: | ||
flavor: none | ||
web: | ||
locations: | ||
"/": | ||
root: "." | ||
passthru: "/index.php" |
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,12 @@ | ||
# The routes of the project. | ||
# | ||
# Each route describes how an incoming URL is going | ||
# to be processed by Platform.sh. | ||
|
||
"https://vanilla.{default}/": | ||
type: upstream | ||
upstream: "vanilla:http" | ||
|
||
"https://advanced.{default}/": | ||
type: upstream | ||
upstream: "advanced:http" |
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,77 @@ | ||
Platform.sh PHP 5.4 Example | ||
=========================== | ||
|
||
This example exists to test this plugin's implementation of Platform.sh's `php:5.4` service. | ||
|
||
* [`php:5.4`](https://docs.platform.sh/configuration/services/php.html) | ||
|
||
Start up tests | ||
-------------- | ||
|
||
Run the following commands to get up and running with this example. | ||
|
||
```bash | ||
# Should poweroff | ||
lando poweroff | ||
|
||
# Should start up successfully | ||
lando start | ||
``` | ||
|
||
Verification commands | ||
--------------------- | ||
|
||
Run the following commands to validate things are rolling as they should. | ||
|
||
```bash | ||
# Should have the expected platformsh containers and images | ||
docker ps --filter label=com.docker.compose.project=landoplatformshphp54 | grep docker.registry.platform.sh/php-5.4 | grep landoplatformshphp54_vanilla_1 | ||
docker ps --filter label=com.docker.compose.project=landoplatformshphp54 | grep docker.registry.platform.sh/php-5.4 | grep landoplatformshphp54_advanced_1 | ||
|
||
# Should be running application containers as web | ||
lando ssh -s vanilla -c "id" | grep web | ||
lando ssh -s advanced -c "id" | grep web | ||
|
||
# Should have the platform cli in application containers | ||
lando ssh -s vanilla -c "platform -V" | ||
lando ssh -s advanced -c "platform -V" | ||
|
||
# Should be running the correct php version | ||
lando ssh -s vanilla -c "php --version" | grep 5.4. | ||
lando ssh -s advanced -c "php --version" | grep 5.4. | ||
|
||
# Should serve php files | ||
lando ssh -s vanilla -c "curl localhost:80" | grep "PHP Version 5.4." | ||
lando ssh -s advanced -c "curl localhost:80" | grep "PHP Version 5.4." | ||
|
||
# Should have the correct version of composer | ||
# lando ssh -s vanilla -c "composer --version --no-ansi" | grep "Composer 1." | ||
lando ssh -s advanced -c "composer --version --no-ansi" | grep "Composer 2." | ||
|
||
# Should prefer deps installed in application yamls | ||
# lando ssh -s vanilla -c "which composer" | grep "/usr/local/bin/composer" | ||
lando ssh -s advanced -c "which composer" | grep "/app/.platform/local/deps/php/vendor/bin/composer" | ||
|
||
# Should have the correct extensions installed | ||
lando ssh -s vanilla -c "php -m" | grep redis || echo "$?" | grep 1 | ||
lando ssh -s advanced -c "php -m" | grep redis | ||
|
||
# Should run build hooks | ||
lando ssh -s advanced -c "stat /tmp/build" | ||
|
||
# Should run deploy hooks | ||
lando ssh -s advanced -c "stat /tmp/deploy" | ||
``` | ||
|
||
Destroy tests | ||
------------- | ||
|
||
Run the following commands to trash this app like nothing ever happened. | ||
|
||
```bash | ||
# Should be able to destroy our app | ||
lando destroy -y | ||
|
||
# Should poweroff | ||
lando poweroff | ||
``` |
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,26 @@ | ||
name: advanced | ||
type: "php:5.4" | ||
runtime: | ||
extensions: | ||
- redis | ||
dependencies: | ||
php: | ||
"platformsh/client": "2.x-dev" | ||
"composer/composer": "^2" | ||
build: | ||
flavor: composer | ||
hooks: | ||
build: | | ||
set -e | ||
touch /tmp/build | ||
deploy: | | ||
set -e | ||
touch /tmp/deploy | ||
web: | ||
locations: | ||
"/": | ||
root: "." | ||
passthru: "/index.php" | ||
commands: | ||
start: /usr/sbin/php5-fpm |
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,3 @@ | ||
<?php | ||
phpinfo(); | ||
?> |
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,3 @@ | ||
<?php | ||
phpinfo(); | ||
?> |
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 @@ | ||
# Drupal editor configuration normalization | ||
# @see http://editorconfig.org/ | ||
|
||
# This is the top-most .editorconfig file; do not search in parent directories. | ||
root = true | ||
|
||
# All files. | ||
[*] | ||
end_of_line = LF | ||
indent_style = space | ||
indent_size = 4 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[composer.{json,lock}] | ||
indent_size = 4 | ||
|
||
[.platform.app.yaml] | ||
indent_size = 4 |
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,11 @@ | ||
vendor | ||
files | ||
data | ||
private | ||
.platform/local | ||
|
||
*.sql | ||
*.tar.gz | ||
*.tar | ||
|
||
.DS_Store |
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,10 @@ | ||
name: lando-platformsh-php-5.5 | ||
recipe: platformsh | ||
config: | ||
id: DISCONNECTED | ||
|
||
|
||
# This is important because it lets lando know to test against the plugin in this repo | ||
# DO NOT REMOVE THIS! | ||
plugins: | ||
"@lando/platformsh": ./../../ |
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,9 @@ | ||
name: vanilla | ||
type: "php:5.5" | ||
build: | ||
flavor: none | ||
web: | ||
locations: | ||
"/": | ||
root: "." | ||
passthru: "/index.php" |
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,12 @@ | ||
# The routes of the project. | ||
# | ||
# Each route describes how an incoming URL is going | ||
# to be processed by Platform.sh. | ||
|
||
"https://vanilla.{default}/": | ||
type: upstream | ||
upstream: "vanilla:http" | ||
|
||
"https://advanced.{default}/": | ||
type: upstream | ||
upstream: "advanced:http" |
Oops, something went wrong.