Skip to content

Commit fa60e3d

Browse files
joeyguerraljharb
authored andcommitted
[Tests] appveyor -> GHA (run tests on Windows in both pwsh and WSL + Ubuntu)
1 parent f3e505b commit fa60e3d

File tree

3 files changed

+154
-165
lines changed

3 files changed

+154
-165
lines changed

.github/workflows/native-wsl.yml

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
name: Native and WSL
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
defaults:
9+
run:
10+
shell: ${{ matrix.configuration == 'wsl' && 'wsl-bash {0}' || 'pwsh' }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [windows-2019]
15+
node-version: [18, 16, 14, 12, 10, 8, 6, 4]
16+
configuration: [wsl, native]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: Vampire/setup-wsl@v3
21+
if: matrix.configuration == 'wsl'
22+
with:
23+
distribution: Ubuntu-22.04
24+
- run: curl --version
25+
- name: 'WSL: do all npm install steps'
26+
if: matrix.configuration == 'wsl'
27+
env:
28+
ESLINT_VERSION: 7
29+
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
30+
run: |
31+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
32+
export NVM_DIR="$HOME/.nvm"
33+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
34+
nvm install --latest-npm ${{ matrix.node-version }}
35+
36+
if [ ${{ matrix.node-version }} -ge 4 ] && [ ${{ matrix.node-version }} -lt 6 ]; then
37+
npm install eslint@4 --no-save --ignore-scripts
38+
npm install
39+
npm install eslint-import-resolver-typescript@1.0.2 --no-save
40+
npm uninstall @angular-eslint/template-parser @typescript-eslint/parser --no-save
41+
fi
42+
if [ ${{ matrix.node-version }} -ge 6 ] && [ ${{ matrix.node-version }} -lt 7 ]; then
43+
npm install eslint@5 --no-save --ignore-scripts
44+
npm install
45+
npm uninstall @angular-eslint/template-parser --no-save
46+
npm install eslint-import-resolver-typescript@1.0.2 @typescript-eslint/parser@3 --no-save
47+
fi
48+
if [ ${{ matrix.node-version }} -ge 7 ] && [ ${{ matrix.node-version }} -lt 8 ]; then
49+
npm install eslint@6 --no-save --ignore-scripts
50+
npm install
51+
npm install eslint-import-resolver-typescript@1.0.2 typescript-eslint-parser@20 --no-save
52+
npm uninstall @angular-eslint/template-parser --no-save
53+
fi
54+
if [ ${{ matrix.node-version }} -eq 8 ]; then
55+
npm install eslint@6 --no-save --ignore-scripts
56+
npm install
57+
npm uninstall @angular-eslint/template-parser --no-save
58+
npm install @typescript-eslint/parser@3 --no-save
59+
fi
60+
if [ ${{ matrix.node-version }} -gt 8 ] && [ ${{ matrix.node-version }} -lt 10 ]; then
61+
npm install eslint@7 --no-save --ignore-scripts
62+
npm install
63+
npm install @typescript-eslint/parser@3 --no-save
64+
fi
65+
if [ ${{ matrix.node-version }} -ge 10 ] && [ ${{ matrix.node-version }} -lt 12 ]; then
66+
npm install
67+
npm install @typescript-eslint/parser@4 --no-save
68+
fi
69+
if [ ${{ matrix.node-version }} -ge 12 ]; then
70+
npm install
71+
fi
72+
npm run copy-metafiles
73+
npm run pretest
74+
npm run tests-only
75+
76+
- name: install dependencies for node <= 10
77+
if: matrix.node-version <= '10' && matrix.configuration == 'native'
78+
run: |
79+
npm install --legacy-peer-deps
80+
npm install eslint@7 --no-save
81+
82+
- name: Install dependencies for node > 10
83+
if: matrix.node-version > '10' && matrix.configuration == 'native'
84+
run: npm install
85+
86+
- name: install the latest version of nyc
87+
if: matrix.configuration == 'native'
88+
run: npm install nyc@latest --no-save
89+
90+
- name: copy metafiles for node <= 8
91+
if: matrix.node-version <= 8 && matrix.configuration == 'native'
92+
env:
93+
ESLINT_VERSION: 6
94+
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
95+
run: |
96+
npm run copy-metafiles
97+
bash ./tests/dep-time-travel.sh 2>&1
98+
- name: copy metafiles for Node > 8
99+
if: matrix.node-version > 8 && matrix.configuration == 'native'
100+
env:
101+
ESLINT_VERSION: 7
102+
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
103+
run: |
104+
npm run copy-metafiles
105+
bash ./tests/dep-time-travel.sh 2>&1
106+
107+
- name: install ./resolver dependencies in Native
108+
if: matrix.configuration == 'native'
109+
shell: pwsh
110+
run: |
111+
npm config set package-lock false
112+
$resolverDir = "./resolvers"
113+
Get-ChildItem -Directory $resolverDir |
114+
ForEach {
115+
Write-output $(Resolve-Path $(Join-Path $resolverDir $_.Name))
116+
Push-Location $(Resolve-Path $(Join-Path $resolverDir $_.Name))
117+
npm install
118+
npm ls nyc > $null;
119+
if ($?) {
120+
npm install nyc@latest --no-save
121+
}
122+
Pop-Location
123+
}
124+
125+
- name: run tests in Native
126+
if: matrix.configuration == 'native'
127+
shell: pwsh
128+
run: |
129+
npm run pretest
130+
npm run tests-only
131+
$resolverDir = "./resolvers";
132+
$resolvers = @();
133+
Get-ChildItem -Directory $resolverDir |
134+
ForEach {
135+
$resolvers += "$(Resolve-Path $(Join-Path $resolverDir $_.Name))";
136+
}
137+
$env:RESOLVERS = [string]::Join(";", $resolvers);
138+
foreach ($resolver in $resolvers) {
139+
Set-Location -Path $resolver.Trim('"')
140+
npm run tests-only
141+
Set-Location -Path $PSScriptRoot
142+
}
143+
144+
- name: codecov
145+
uses: codecov/codecov-action@v3.1.5
146+
147+
windows:
148+
runs-on: ubuntu-latest
149+
needs: [build]
150+
steps:
151+
- run: true

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
1515
- [Refactor] `ExportMap`: make procedures static instead of monkeypatching exportmap ([#2982], thanks [@soryy708])
1616
- [Refactor] `ExportMap`: separate ExportMap instance from its builder logic ([#2985], thanks [@soryy708])
1717
- [Docs] `order`: Add a quick note on how unbound imports and --fix ([#2640], thanks [@minervabot])
18+
- [Tests] appveyor -> GHA (run tests on Windows in both pwsh and WSL + Ubuntu) ([#2987], thanks [@joeyguerra])
1819

1920
## [2.29.1] - 2023-12-14
2021

@@ -1111,6 +1112,7 @@ for info on changes for earlier releases.
11111112

11121113
[`memo-parser`]: ./memo-parser/README.md
11131114

1115+
[#2987]: https://github.com/import-js/eslint-plugin-import/pull/2987
11141116
[#2985]: https://github.com/import-js/eslint-plugin-import/pull/2985
11151117
[#2982]: https://github.com/import-js/eslint-plugin-import/pull/2982
11161118
[#2944]: https://github.com/import-js/eslint-plugin-import/pull/2944
@@ -1791,6 +1793,7 @@ for info on changes for earlier releases.
17911793
[@jkimbo]: https://github.com/jkimbo
17921794
[@joaovieira]: https://github.com/joaovieira
17931795
[@joe-matsec]: https://github.com/joe-matsec
1796+
[@joeyguerra]: https://github.com/joeyguerra
17941797
[@johndevedu]: https://github.com/johndevedu
17951798
[@johnthagen]: https://github.com/johnthagen
17961799
[@jonboiser]: https://github.com/jonboiser

appveyor.yml

Lines changed: 0 additions & 165 deletions
This file was deleted.

0 commit comments

Comments
 (0)