70 lines
1.7 KiB
YAML
70 lines
1.7 KiB
YAML
jobs:
|
|
- job: php
|
|
displayName: PHP Test
|
|
pool:
|
|
vmImage: 'Ubuntu-16.04'
|
|
strategy:
|
|
matrix:
|
|
php71:
|
|
phpVersion: 7.1
|
|
php72:
|
|
phpVersion: 7.2
|
|
variables:
|
|
APP_ENV: testing
|
|
DB_CONNECTION: mysql
|
|
DB_DATABASE: test
|
|
DB_USERNAME: root
|
|
DB_PASSWORD: root
|
|
|
|
steps:
|
|
- script: |
|
|
sudo update-alternatives --set php /usr/bin/php$(phpVersion)
|
|
sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
|
|
sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
|
|
sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
|
|
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
|
|
php -version
|
|
displayName: 'Use PHP version $(phpVersion)'
|
|
|
|
- script: composer install --no-interaction --prefer-dist
|
|
displayName: 'composer install'
|
|
|
|
- script: |
|
|
cp .env.testing .env
|
|
php artisan key:random
|
|
php artisan salt:random
|
|
mysql -uroot -proot -e 'CREATE DATABASE IF NOT EXISTS test;'
|
|
displayName: 'Prepare testing environment'
|
|
|
|
- script: ./vendor/bin/phpunit --log-junit junit.xml
|
|
displayName: Test
|
|
|
|
- task: PublishTestResults@2
|
|
condition: succeededOrFailed()
|
|
inputs:
|
|
testRunner: JUnit
|
|
testResultsFiles: './junit.xml'
|
|
|
|
- job: javascript
|
|
displayName: JavaScript and Vue Test
|
|
pool:
|
|
vmImage: 'Ubuntu-16.04'
|
|
steps:
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: 10
|
|
|
|
- script: yarn
|
|
displayName: Install dependencies
|
|
|
|
- script: |
|
|
yarn lint
|
|
yarn test --ci --reporters=default --reporters=jest-junit --coverage
|
|
displayName: 'Run Test'
|
|
|
|
- task: PublishTestResults@2
|
|
condition: succeededOrFailed()
|
|
inputs:
|
|
testRunner: JUnit
|
|
testResultsFiles: './junit.xml'
|