integer-net/magento2-addtocartgraphql

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
os: linux
dist: xenial
group: edge
services:
  - mysql
addons:
  apt:
    packages:
      - postfix
  hosts:
    - magento2.travis
language: php
jobs:
  include:
    -
      php: "7.3"
      env:
        - "MAGENTO_VERSION=2.4"
        - "TEST_SUITE=integration"

    -
      php: "7.4"
      env:
        - "MAGENTO_VERSION=2.4"
        - "TEST_SUITE=integration"
        - "COVERAGE=true"

    -
      php: "7.4"
      env:
        - "MAGENTO_VERSION=2.4"
        - "TEST_SUITE=unit"
        - "COVERAGE=true"

    -
      php: "7.4"
      env:
        - "MAGENTO_VERSION=2.4-develop"
        - "TEST_SUITE=integration"

  allow_failures:
    -
      php: "7.4"
      env:
        - "MAGENTO_VERSION=2.4-develop"
        - "TEST_SUITE=integration"


env:
  global:
    - COMPOSER_BIN_DIR=~/bin
    - COMPOSER_PACKAGE_NAME=integer-net/magento2-addtocartgraphql
cache:
  apt: true
  directories:
    - $HOME/.composer/cache
before_install:
  - |
    [[ $TEST_SUITE == "unit" ]] || (
    curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-amd64.deb
    sudo dpkg -i --force-confnew elasticsearch-7.6.2-amd64.deb
    sudo chown -R elasticsearch:elasticsearch /etc/default/elasticsearch
    sudo service elasticsearch restart
    )
before_script:
  - |
    sleep 10
    ./.travis/before_script.sh
script: phpunit -c magento2/dev/tests/$TEST_SUITE `[[ $COVERAGE == "true" ]] && echo "--coverage-text --coverage-clover=/tmp/coverage.clover"`
after_script:
  - |
    [[ $COVERAGE == "true" ]] && wget https://scrutinizer-ci.com/ocular.phar
    [[ $COVERAGE == "true" ]] && php ocular.phar code-coverage:upload --format=php-clover /tmp/coverage.clover