forked from AmpersandHQ/magento2-disable-stock-reservation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
88 lines (79 loc) · 3.8 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
language: php
php:
- 7.4
- 8.1
git:
depth: false
dist: xenial
env:
- TEST_GROUP=magento_latest
- TEST_GROUP=magento_242
- TEST_GROUP=magento_23
jobs:
exclude:
- php: 8.1
env: TEST_GROUP=magento_23
- php: 8.1
env: TEST_GROUP=magento_242
- php: 7.4
env: TEST_GROUP=magento_latest
install:
# Composer install
- composer install --no-interaction
# Do a quick code style check
- PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --dry-run --rules=@PSR2 --diff src/
# Magento coding standard check
- vendor/bin/phpcs -s --standard=./ruleset.xml src/
# Install magento
- if [[ $TEST_GROUP = magento_242 ]]; then NAME=disablestockres VERSION=2.4.2 . ./vendor/bin/travis-install-magento.sh; fi
- if [[ $TEST_GROUP = magento_23 ]]; then NAME=disablestockres VERSION=2.3.7-p2 . ./vendor/bin/travis-install-magento.sh; fi
- if [[ $TEST_GROUP = magento_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 oauth/consumer/enable_integration_as_bearer 1
- magerun2 config:store:set checkout/options/guest_checkout 1
- magerun2 config:store:set payment/checkmo/active 1
- magerun2 integration:create disablestockres example@example.com 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 || (mkdir -p $HOME/bin/ && wget https://files.magerun.net/n98-magerun2-4.9.1.phar && chmod +x n98-magerun2-4.9.1.phar && mv n98-magerun2-4.9.1.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