-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathazure-pipelines.yml
88 lines (74 loc) · 2.83 KB
/
azure-pipelines.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
# PHP
# Test and package your PHP project.
# Add steps that run tests, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/php
pool:
vmImage: 'Ubuntu 20.04'
variables:
phpVersion: 8.0
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: |
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y build-essential debconf-utils screen nodejs mysql-server google-chrome-stable
sudo apt-get install -y unzip xvfb autogen autoconf libtool pkg-config nasm
displayName: 'Installing System Dependencies'
- script: |
mysql --version
displayName: 'MySQL Version'
- script: |
sudo service mysql start
sudo mysql -u root -proot -e "use mysql; ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'invoiceneko_password'; FLUSH PRIVILEGES;"
sudo mysql -u root -pinvoiceneko_password -e 'create database invoiceneko_test;'
displayName: 'Set MySQL credentials'
- script: |
cp .env.travis .env
displayName: 'Environment Setup'
- script: |
sudo composer self-update
composer install --no-interaction --prefer-dist --no-suggest
composer --version
displayName: 'Installing Package Dependencies'
- script: |
php artisan key:generate
php artisan migrate
displayName: 'Running Migrations'
- script: |
npm install --global yarn
sudo chown -R vsts:vsts ~/.npm
sudo chown -R vsts:vsts ~/.config
yarn install
yarn run prod
node -v
displayName: 'Generating build assets'
- script: |
google-chrome-stable --version
screen -d -m google-chrome-stable --headless --disable-gpu --disable-dev-shm-usage --disable-software-rasterizer --remote-debugging-port=9222 http://localhost &
screen -d -m php artisan serve &
displayName: 'Starting Chrome and the Web Server'
- script: |
composer run test
displayName: 'Running Unit Tests'
- script: |
php artisan dusk:chrome-driver --detect
composer run test:dusk
displayName: 'Running Browser Tests'
# Publish Test Results to Azure Pipelines/TFS
- task: PublishTestResults@2
inputs:
testRunner: 'JUnit' # Options: JUnit, NUnit, VSTest, xUnit
testResultsFiles: '**/TEST-*.xml'
searchFolder: '$(System.DefaultWorkingDirectory)/tests/Results' # Optional
mergeTestResults: false # Optional
#testRunTitle: # Optional
#buildPlatform: # Optional
#buildConfiguration: # Optional
#publishRunAttachments: true # Optional
condition: always()