forked from aligent/magento2-disable-stock-reservation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
72 lines (64 loc) · 3.21 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
61
62
63
64
65
66
67
68
69
70
71
72
language: php
php: 7.4.22
dist: xenial
git:
depth: false
env:
- TEST_GROUP=latest
- TEST_GROUP=two_three
install:
# Composer install
- composer install --no-interaction
# Do a quick code style check
- ./vendor/bin/php-cs-fixer fix --dry-run --rules=@PSR2 --diff src/
# Install magento
- if [[ $TEST_GROUP = two_three ]]; then NAME=disablestockres VERSION=2.3.7-p2 . ./vendor/bin/travis-install-magento.sh; fi
- if [[ $TEST_GROUP = latest ]]; then NAME=disablestockres . ./vendor/bin/travis-install-magento.sh; fi
# Install this module
- cd vendor/ampersand/travis-vanilla-magento/instances/disablestockres
- export COMPOSER_MEMORY_LIMIT=-1
- composer config repo.disablestockres git "../../../../../"
- composer require -vvv ampersand/magento2-disable-stock-reservation:"dev-$TRAVIS_BRANCH" || composer require -vvv ampersand/magento2-disable-stock-reservation $TRAVIS_BRANCH
- php bin/magento setup:upgrade
# compile magento
- php bin/magento setup:di:compile
# Set up test configuration
- magerun2 config:store:set checkout/options/guest_checkout 1
- magerun2 config:store:set payment/checkmo/active 1
- magerun2 integration:create disablestockres [email protected] https://example.com --access-token="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- magerun2 cache:flush
# warm caches
- php bin/magento
- magerun2 sys:info
- cd -
before_install:
- if [ ! "$TRAVIS_PULL_REQUEST" = "false" ]; then git branch; git branch -D "$TRAVIS_BRANCH" || true; git checkout -b "$TRAVIS_BRANCH"; fi
- composer self-update --2
- mkdir -p $HOME/bin/
# Install magerun2
- test -f $HOME/bin/magerun2 || (wget https://files.magerun.net/n98-magerun2-latest.phar && chmod +x n98-magerun2-latest.phar && mv n98-magerun2-latest.phar $HOME/bin/magerun2)
script:
- ADDITIONAL_ARGS="-v"
- if [[ $TRAVIS_COMMIT_MESSAGE == *"VERBOSE"* ]]; then ADDITIONAL_ARGS="-vvv"; fi;
- ./vendor/bin/codecept build -c dev
- URL="https://magento-disablestockres.localhost/" MYSQL_USER="root" MYSQL_HOST="127.0.0.1" MYSQL_DB="databasedisablestockres" MYSQL_PORT="3306" ./vendor/bin/codecept run acceptance -c dev $ADDITIONAL_ARGS
addons:
apt:
packages:
- postfix
- apache2
- libapache2-mod-fastcgi
services:
- mysql
- elasticsearch
cache:
apt: true
directories:
- $HOME/.composer/cache
- $HOME/bin
after_failure:
- test -d ./vendor/ampersand/travis-vanilla-magento/instances/disablestockres/var/report/ && for r in ./vendor/ampersand/travis-vanilla-magento/instances/disablestockres/var/report/*; do cat $r; done
- test -f ./vendor/ampersand/travis-vanilla-magento/instances/disablestockres/var/log/system.log && grep -v "Broken reference" ./vendor/ampersand/travis-vanilla-magento/instances/disablestockres/var/log/system.log
- test -f ./vendor/ampersand/travis-vanilla-magento/instances/disablestockres/var/log/exception.log && cat ./vendor/ampersand/travis-vanilla-magento/instances/disablestockres/var/log/exception.log
- test -f ./vendor/ampersand/travis-vanilla-magento/instances/disablestockres/var/log/support_report.log && grep -v "Broken reference" ./vendor/ampersand/travis-vanilla-magento/instances/disablestockres/var/log/support_report.log
- sleep 10; # give log files time to render