-
Notifications
You must be signed in to change notification settings - Fork 60
/
appveyor.yml
83 lines (77 loc) · 2.15 KB
/
appveyor.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
build: off
image: Visual Studio 2017
version: '{build}'
branches:
only:
- master
cache:
- .eslintcache
- .jest-cache
- node_modules
- test\test-app\node_modules
platform: x64
services:
- mysql
- postgresql
environment:
nodejs_version: 6.10.0
NODE_ENV: test
CREATE_DATABASE: CREATE DATABASE lux_test;
DROP_DATABASE: DROP DATABASE IF EXISTS lux_test;
DATABASE_PASSWORD: Password12!
matrix:
- DATABASE_DRIVER: pg
DATABASE_USERNAME: postgres
- DATABASE_DRIVER: mysql2
DATABASE_USERNAME: root
- DATABASE_DRIVER: sqlite3
install:
- ps: Install-Product node $env:nodejs_version $env:platform
- yarn install
- npm link
- ps: Set-Location C:\projects\lux\test\test-app
- yarn install
- ps: Set-Location C:\projects\lux
before_test:
- |
SET PATH=C:\Program Files\PostgreSQL\9.5\bin;%PATH%
SET PGUSER=postgres
SET PGPASSWORD=%DATABASE_PASSWORD%
psql -c "%DROP_DATABASE%"
psql -c "%CREATE_DATABASE%"
- ps: |
if ($env:DATABASE_DRIVER -eq "mysql2") {
$env:MYSQL_PWD="$env:DATABASE_PASSWORD"
$mysql="C:\Program Files\MySql\MySQL Server 5.7\bin\mysql"
Invoke-Expression "& '$mysql' -e '$env:DROP_DATABASE' -u root"
Invoke-Expression "& '$mysql' -e '$env:CREATE_DATABASE' -u root"
}
if ($env:DATABASE_DRIVER -eq "sqlite3") {
Remove-Item C:\projects\lux\test\test-app\db\* -Force -Include *.sqlite
Write-Host $null >> C:\projects\lux\test\test-app\db\lux_test_test.sqlite
}
- yarn run clean
- ps: |
$env:NODE_ENV="production"
Set-Location C:\projects\lux
yarn build
$env:NODE_ENV="test"
Set-Location C:\projects\lux\test\test-app
lux build -e test
if ($env:DATABASE_DRIVER -ne "sqlite3") {
lux db:migrate -e test --skip-build
lux db:seed -e test --skip-build
}
Set-Location C:\projects\lux
test_script:
- yarn lint
- yarn flow
- ps: yarn test -- --colors --no-watchman
- yarn codecov
notifications:
- provider: Webhook
url: https://webhooks.gitter.im/e/070ebbf83dc0f595c4fb
method: POST
on_build_success: true
on_build_failure: true
on_build_status_changed: false