Skip to content

Commit

Permalink
[Tests] appveyor -> GHA (run tests on Windows in both pwsh and WSL + …
Browse files Browse the repository at this point in the history
…Ubuntu)
  • Loading branch information
joeyguerra authored and ljharb committed Mar 19, 2024
1 parent f3e505b commit fa60e3d
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 165 deletions.
151 changes: 151 additions & 0 deletions .github/workflows/native-wsl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
name: Native and WSL

on: [push, 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 eslint-import-resolver-typescript@1.0.2 --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 eslint-import-resolver-typescript@1.0.2 @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 eslint-import-resolver-typescript@1.0.2 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/codecov-action@v3.1.5

windows:
runs-on: ubuntu-latest
needs: [build]
steps:
- run: true
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
- [Refactor] `ExportMap`: make procedures static instead of monkeypatching exportmap ([#2982], thanks [@soryy708])
- [Refactor] `ExportMap`: separate ExportMap instance from its builder logic ([#2985], thanks [@soryy708])
- [Docs] `order`: Add a quick note on how unbound imports and --fix ([#2640], thanks [@minervabot])
- [Tests] appveyor -> GHA (run tests on Windows in both pwsh and WSL + Ubuntu) ([#2987], thanks [@joeyguerra])

## [2.29.1] - 2023-12-14

Expand Down Expand Up @@ -1111,6 +1112,7 @@ for info on changes for earlier releases.

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

[#2987]: https://github.com/import-js/eslint-plugin-import/pull/2987
[#2985]: https://github.com/import-js/eslint-plugin-import/pull/2985
[#2982]: https://github.com/import-js/eslint-plugin-import/pull/2982
[#2944]: https://github.com/import-js/eslint-plugin-import/pull/2944
Expand Down Expand Up @@ -1791,6 +1793,7 @@ for info on changes for earlier releases.
[@jkimbo]: https://github.com/jkimbo
[@joaovieira]: https://github.com/joaovieira
[@joe-matsec]: https://github.com/joe-matsec
[@joeyguerra]: https://github.com/joeyguerra
[@johndevedu]: https://github.com/johndevedu
[@johnthagen]: https://github.com/johnthagen
[@jonboiser]: https://github.com/jonboiser
Expand Down
165 changes: 0 additions & 165 deletions appveyor.yml

This file was deleted.

0 comments on commit fa60e3d

Please sign in to comment.