Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Enable Travis PHP Build on Windows
# default os is linux
matrix:
include:
- language: php
php: 7.2
before_script:
- composer install
after_script:
- sh .travis.coverage.sh
env:
- COVERAGE_FLAGS="--coverage-text --coverage-clover=clover.xml"
- name: "PHP: 7.2"
language: sh
os: windows
before_script:
# Use chocolatey to install certain php version
# Skipp --version to install latest stable release
- choco install php --version 7.2.15 --package-parameters='"/InstallDir:C:\php"'
# Export windows path into unix path
- export PATH=/c/php:$PATH
# Enable openssl used by composer
- sed -i 's/;extension=openssl/extension=openssl/g' /c/php/php.ini
# Enable mbstring used by phpunit
- sed -i 's/;extension=mbstring/extension=mbstring/g' /c/php/php.ini
#
# You might want to enable other extensions as needed ...
#
# Fetch composer
- wget http://getcomposer.org/composer.phar
# Install dependencies
- php composer.phar install
allow_failures:
- php: nightly
script:
- vendor/bin/phpunit --verbose ${COVERAGE_FLAGS} --colors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment