Skip to content

Commit

Permalink
test: add Vagrantfile for local dev and testing on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsey committed Aug 12, 2020
1 parent 43d45c2 commit 5173022
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions resources/vagrant/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vagrant/
16 changes: 16 additions & 0 deletions resources/vagrant/windows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Run tests on Windows

``` bash
cd /path/to/conventional-commits/resources/vagrant/windows
vagrant up
vagrant ssh
```

Once inside the VM:

``` bash
refreshenv
cd conventional-commits
composer install
composer test
```
21 changes: 21 additions & 0 deletions resources/vagrant/windows/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

$script = <<-SCRIPT
choco install composer php unzip --no-progress -y
Invoke-WebRequest -Uri https://windows.php.net/downloads/pecl/releases/pcov/1.0.6/php_pcov-1.0.6-7.4-nts-vc15-x64.zip -UseBasicParsing -OutFile C:\\temp\\php_pcov.zip
unzip C:\\temp\\php_pcov.zip -d C:\\temp\\php_pcov
move C:\\temp\\php_pcov\\php_pcov.dll C:\\tools\\php74\\ext\\php_pcov.dll
Add-Content C:\\tools\\php74\\php.ini "`nextension=pcov"
composer self-update --preview
SCRIPT

Vagrant.configure("2") do |config|
config.vm.box = "jborean93/WindowsServer2019"
config.vm.provision "shell", inline: $script
config.vm.synced_folder "../../../", "C:\\Users\\vagrant\\conventional-commits"

config.vm.provider "virtualbox" do |vb|
vb.name = "ramsey-conventional-commits-windows"
end
end

0 comments on commit 5173022

Please sign in to comment.