-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
60 lines (44 loc) · 1.68 KB
/
.travis.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
language: php
node_js:
- 12
services:
- docker
php:
- 7.2
- 7.3
env:
matrix:
- LARAVEL=5.8.*
- LARAVEL=6.0.*
before_install:
# Install Serverless
- npm install -g serverless@1.43.0
# Install package's composer
- composer install
# Install Laravel
- export TMP_LARAVEL_PATH=/tmp/laravel
- composer create-project laravel/laravel $TMP_LARAVEL_PATH ${LARAVEL} --prefer-dist
- cd $TMP_LARAVEL_PATH
# Copy across the layers
- cp -R $TRAVIS_BUILD_DIR/layers .
- cp layers/laravelBootstrap.php layers/web/
- cp layers/laravelBootstrap.php layers/cli/
# Install laravel-serverless
- composer config repositories.ignited/laravel-serverless path $TRAVIS_BUILD_DIR
- composer require ignited/laravel-serverless "@dev" --prefer-source
before_script:
# Copy Serverless Config
- cp $TRAVIS_BUILD_DIR/tests/serverless.yml .
- export PHP_VERSION=$(echo "$TRAVIS_PHP_VERSION" | sed -e 's/\.//g')
script:
# Test the package's PHPunit
- ( cd $TRAVIS_BUILD_DIR ; vendor/bin/phpunit )
# Now Test the Laravel Install
# Test HTTP Works
- serverless invoke local --docker --function web --path $TRAVIS_BUILD_DIR/tests/events/http.json -l 2>&1 | tee http.response
- cat http.response | tail -n 2 | head -n 1 | jq -r '.statusCode' | grep "200"
- cat http.response | tail -n 2 | head -n 1 | jq -r '.body' | grep "<title>Laravel</title>"
# Test CLI Works
- serverless invoke local --docker --function cli --path $TRAVIS_BUILD_DIR/tests/events/cli.json -l | tee cli.response
- cat cli.response | tail -n 2 | head -n 1 | jq -r '.exitCode' | grep "0"
- cat cli.response | tail -n 2 | head -n 1 | jq -r '.output' | base64 --decode | grep 'Configuration cache cleared!'