forked from import-js/eslint-plugin-import
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
138 lines (120 loc) · 3.8 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
configuration:
- Native
- WSL
# Test against this version of Node.js
environment:
matrix:
- nodejs_version: "14"
- nodejs_version: "12"
- nodejs_version: "10"
- nodejs_version: "8"
# - nodejs_version: "6"
# - nodejs_version: "4"
image: Visual Studio 2019
matrix:
fast_finish: false
exclude:
- configuration: WSL
nodejs_version: "8"
# allow_failures:
# - nodejs_version: "4" # for eslint 5
# platform:
# - x86
# - x64
# Initialization scripts. (runs before repo cloning)
init:
# Declare version-numbers of packages to install
- ps: >-
if ($env:nodejs_version -eq "4") {
$env:NPM_VERSION="3"
}
if ($env:nodejs_version -in @("8", "10", "12")) {
$env:NPM_VERSION="6.14.5"
}
- ps: >-
if ([int]$env:nodejs_version -le 8) {
$env:ESLINT_VERSION="6"
}
- ps: $env:WINDOWS_NYC_VERSION = "15.0.1"
# Add `ci`-command to `PATH` for running commands either using cmd or wsl depending on the configuration
- ps: $env:PATH += ";$(Join-Path $(pwd) "scripts")"
# Install scripts. (runs after repo cloning)
before_build:
# Install propert `npm`-version
- IF DEFINED NPM_VERSION ci sudo npm install -g npm@%NPM_VERSION%
# Install dependencies
- ci npm install
# fix symlinks
- git config core.symlinks true
- git reset --hard
- ci git reset --hard
# Install dependencies of resolvers
- ps: >-
$resolverDir = "./resolvers";
$resolvers = @();
Get-ChildItem -Directory $resolverDir |
ForEach {
$resolvers += "$(Resolve-Path $(Join-Path $resolverDir $_))";
}
$env:RESOLVERS = [string]::Join(";", $resolvers);
- FOR %%G in ("%RESOLVERS:;=";"%") do ( pushd %%~G & ci npm install & popd )
# Install proper `eslint`-version
- IF DEFINED ESLINT_VERSION ci npm install --no-save eslint@%ESLINT_VERSION%
# Build scripts (project isn't actually built)
build_script:
- ps: "# This Project isn't actually built"
# Test scripts
test_script:
# Output useful info for debugging.
- ci node --version
- ci npm --version
# Run core tests
- ci npm run pretest
- ci npm run tests-only
# Run resolver tests
- ps: >-
$resolverDir = "./resolvers";
$resolvers = @();
Get-ChildItem -Directory $resolverDir |
ForEach {
$resolvers += "$(Resolve-Path $(Join-Path $resolverDir $_))";
}
$env:RESOLVERS = [string]::Join(";", $resolvers);
- FOR %%G in ("%RESOLVERS:;=";"%") do ( pushd %%~G & ci npm test & popd )
on_success:
- ci npm run coveralls
# Configuration-specific steps
for:
- matrix:
except:
- configuration: WSL
install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version
before_test:
# Upgrade nyc
- ci npm i --no-save nyc@%WINDOWS_NYC_VERSION%
- ps: >-
$resolverDir = "./resolvers";
$resolvers = @();
Get-ChildItem -Directory $resolverDir |
ForEach {
Push-Location $(Resolve-Path $(Join-Path $resolverDir $_));
ci npm ls nyc > $null;
if ($?) {
$resolvers += "$(pwd)";
}
Pop-Location;
}
$env:RESOLVERS = [string]::Join(";", $resolvers);
- IF DEFINED RESOLVERS FOR %%G in ("%RESOLVERS:;=";"%") do ( pushd %%~G & ci npm install --no-save nyc@%WINDOWS_NYC_VERSION% & popd )
- matrix:
only:
- configuration: WSL
# Install scripts. (runs after repo cloning)
install:
# Get a specific version of Node.js
- ps: $env:WSLENV += ":nodejs_version"
- ps: wsl curl -sL 'https://deb.nodesource.com/setup_${nodejs_version}.x' `| sudo APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 -E bash -
- wsl sudo DEBIAN_FRONTEND=noninteractive apt install -y nodejs
build: on