heiseonline/shariff-backend-php

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
language: php

sudo: false

php:
 - 7.4
 - 8.0
 - 8.1
 - 8.2

env:
  - SHARIFF_RUN_LINT=1
  - SHARIFF_RUN_TEST=1

before_script:
 - bash -c 'if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi;'
 - bash -c 'if [ -n "$SHARIFF_RUN_TEST" ]; then composer install --prefer-dist --no-interaction; fi;'
 - bash -c 'if [ -n "$SHARIFF_RUN_LINT" ]; then composer require "squizlabs/php_codesniffer=*"; fi;'
 - bash -c 'if [ -n "$SHARIFF_RUN_LINT" ]; then composer require friendsofphp/php-cs-fixer --dev; fi;'

script:
 - bash -c 'if [ -n "$SHARIFF_RUN_LINT" ]; then vendor/bin/phpcs --standard=PSR12 index.php src/ tests/; fi;'
 - bash -c 'if [ -n "$SHARIFF_RUN_LINT" ]; then make cs_dry_run; fi;'
 - bash -c 'if [ -n "$SHARIFF_RUN_TEST" ]; then export XDEBUG_MODE=coverage; vendor/bin/phpunit --coverage-text -v; fi;'

addons:
 apt:
  packages:
   - p7zip-full

before_deploy:
 - bash build.sh
 - 7z a -tzip shariff-backend-php.zip ./build/*
 - 7z a -ttar -so shariff-backend-php.tar ./build/* | 7z a -si shariff-backend-php.tar.gz

deploy:
  provider: releases
  api_key:
    secure: "hWhqbxUyf/x1ou1b/Lj4SFRDH43rRQb4iC2kDwv4/LylibW+k3FIRjH68no7DGEaZML1J7wnKmOVj/AKR+HfPaerqad7aG43ft7IfRGmmB/+syWUo1HM7LzkpaQpN+cV9awuUdIUOSnOMq5Jm3Dx1AHDMJuNsJVUAt9m53h/p/M="
  file:
   - shariff-backend-php.zip
   - shariff-backend-php.tar.gz
  skip_cleanup: true
  on:
    repo: heiseonline/shariff-backend-php
    tags: true
    php: 7.4
    condition: $SHARIFF_RUN_TEST = 1