-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
155 lines (142 loc) · 5.4 KB
/
native-wsl.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Native and WSL
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.configuration == 'wsl' && 'wsl-bash {0}' || 'pwsh' }}
strategy:
fail-fast: false
matrix:
os: [windows-2019]
node-version: [18, 16, 14, 12, 10, 8, 6, 4]
configuration: [wsl, native]
steps:
- uses: actions/checkout@v4
- uses: Vampire/setup-wsl@v3
if: matrix.configuration == 'wsl'
with:
distribution: Ubuntu-22.04
- run: curl --version
- name: 'WSL: do all npm install steps'
if: matrix.configuration == 'wsl'
env:
ESLINT_VERSION: 7
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm install --latest-npm ${{ matrix.node-version }}
if [ ${{ matrix.node-version }} -ge 4 ] && [ ${{ matrix.node-version }} -lt 6 ]; then
npm install eslint@4 --no-save --ignore-scripts
npm install
npm install [email protected] --no-save
npm uninstall @angular-eslint/template-parser @typescript-eslint/parser --no-save
fi
if [ ${{ matrix.node-version }} -ge 6 ] && [ ${{ matrix.node-version }} -lt 7 ]; then
npm install eslint@5 --no-save --ignore-scripts
npm install
npm uninstall @angular-eslint/template-parser --no-save
npm install [email protected] @typescript-eslint/parser@3 --no-save
fi
if [ ${{ matrix.node-version }} -ge 7 ] && [ ${{ matrix.node-version }} -lt 8 ]; then
npm install eslint@6 --no-save --ignore-scripts
npm install
npm install [email protected] typescript-eslint-parser@20 --no-save
npm uninstall @angular-eslint/template-parser --no-save
fi
if [ ${{ matrix.node-version }} -eq 8 ]; then
npm install eslint@6 --no-save --ignore-scripts
npm install
npm uninstall @angular-eslint/template-parser --no-save
npm install @typescript-eslint/parser@3 --no-save
fi
if [ ${{ matrix.node-version }} -gt 8 ] && [ ${{ matrix.node-version }} -lt 10 ]; then
npm install eslint@7 --no-save --ignore-scripts
npm install
npm install @typescript-eslint/parser@3 --no-save
fi
if [ ${{ matrix.node-version }} -ge 10 ] && [ ${{ matrix.node-version }} -lt 12 ]; then
npm install
npm install @typescript-eslint/parser@4 --no-save
fi
if [ ${{ matrix.node-version }} -ge 12 ]; then
npm install
fi
npm run copy-metafiles
npm run pretest
npm run tests-only
- name: install dependencies for node <= 10
if: matrix.node-version <= '10' && matrix.configuration == 'native'
run: |
npm install --legacy-peer-deps
npm install eslint@7 --no-save
- name: Install dependencies for node > 10
if: matrix.node-version > '10' && matrix.configuration == 'native'
run: npm install
- name: install the latest version of nyc
if: matrix.configuration == 'native'
run: npm install nyc@latest --no-save
- name: copy metafiles for node <= 8
if: matrix.node-version <= 8 && matrix.configuration == 'native'
env:
ESLINT_VERSION: 6
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
run: |
npm run copy-metafiles
bash ./tests/dep-time-travel.sh 2>&1
- name: copy metafiles for Node > 8
if: matrix.node-version > 8 && matrix.configuration == 'native'
env:
ESLINT_VERSION: 7
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
run: |
npm run copy-metafiles
bash ./tests/dep-time-travel.sh 2>&1
- name: install ./resolver dependencies in Native
if: matrix.configuration == 'native'
shell: pwsh
run: |
npm config set package-lock false
$resolverDir = "./resolvers"
Get-ChildItem -Directory $resolverDir |
ForEach {
Write-output $(Resolve-Path $(Join-Path $resolverDir $_.Name))
Push-Location $(Resolve-Path $(Join-Path $resolverDir $_.Name))
npm install
npm ls nyc > $null;
if ($?) {
npm install nyc@latest --no-save
}
Pop-Location
}
- name: run tests in Native
if: matrix.configuration == 'native'
shell: pwsh
run: |
npm run pretest
npm run tests-only
$resolverDir = "./resolvers";
$resolvers = @();
Get-ChildItem -Directory $resolverDir |
ForEach {
$resolvers += "$(Resolve-Path $(Join-Path $resolverDir $_.Name))";
}
$env:RESOLVERS = [string]::Join(";", $resolvers);
foreach ($resolver in $resolvers) {
Set-Location -Path $resolver.Trim('"')
npm run tests-only
Set-Location -Path $PSScriptRoot
}
- name: codecov
uses: codecov/[email protected]
windows:
runs-on: ubuntu-latest
needs: [build]
steps:
- run: true