-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
104 lines (92 loc) · 2.95 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
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: [22, 20, 18]
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
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 }}
npm install
npm run copy-metafiles
npm run pretest
npm run tests-only
- name: Install dependencies in Native
if: matrix.configuration == 'native'
run: npm install
- name: install the latest version of nyc in Native
if: matrix.configuration == 'native'
run: npm install nyc@latest --no-save
- name: copy metafiles in Native
if: matrix.configuration == 'native'
env:
ESLINT_VERSION: 7
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