Skip to content

Commit 8285963

Browse files
committed
ci: debug package managers
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
1 parent 1e869a3 commit 8285963

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252
- os: macos-latest # macos-latest has issues with node14
5353
node-version: "14"
5454
steps:
55+
- name: test npm
56+
run: npm --version
5557
- name: Checkout
5658
# see https://github.com/actions/checkout
5759
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
@@ -102,6 +104,29 @@ jobs:
102104
with:
103105
node-version: ${{ matrix.node-version }}
104106
package-manager-cache: false # must not usecaches. we want the latest, always
107+
- name: Remove Yarn 1 from PATH (Windows)
108+
if: ${{ runner.os == 'Windows' }}
109+
shell: pwsh
110+
run: |
111+
Set-PSDebug -Trace 1
112+
# find yarn
113+
Get-Alias yarn -ErrorAction SilentlyContinue
114+
Get-ChildItem Function:\yarn -ErrorAction SilentlyContinue
115+
Get-Command yarn
116+
# remove yarn
117+
Remove-Item Alias:\yarn -Verbose -ErrorAction SilentlyContinue
118+
Remove-Item Function:\yarn -Verbose -ErrorAction SilentlyContinue
119+
Remove-Item "C:\npm\prefix\yarn*" -Verbose -Force -ErrorAction SilentlyContinue
120+
# verify
121+
Get-Alias yarn -ErrorAction SilentlyContinue
122+
Get-ChildItem Function:\yarn -ErrorAction SilentlyContinue
123+
Get-Command yarn -ErrorAction SilentlyContinue
124+
- name: enable yarn
125+
run: |-
126+
corepack enable yarn
127+
corepack prepare yarn@latest --activate
128+
yarn --version
129+
working-directory: .. # prevent evaluation of package.json
105130
- name: install project
106131
run: >
107132
yarn install
@@ -148,11 +173,30 @@ jobs:
148173
with:
149174
node-version: ${{ matrix.node-version }}
150175
package-manager-cache: false # must not usecaches. we want the latest, always
176+
- name: Remove PNPM from PATH (Windows)
177+
if: ${{ runner.os == 'Windows' }}
178+
shell: pwsh
179+
run: |
180+
Set-PSDebug -Trace 1
181+
# find pnpm
182+
Get-Alias pnpm -ErrorAction SilentlyContinue
183+
Get-ChildItem Function:\pnpm -ErrorAction SilentlyContinue
184+
Get-Command pnpm -ErrorAction SilentlyContinue
185+
# remove pnpm
186+
Remove-Item Alias:\pnpm -Verbose -ErrorAction SilentlyContinue
187+
Remove-Item Function:\pnpm -Verbose -ErrorAction SilentlyContinue
188+
Remove-Item "C:\npm\prefix\pnpm*" -Verbose -Force -ErrorAction SilentlyContinue
189+
# verify
190+
Get-Alias pnpm -ErrorAction SilentlyContinue
191+
Get-ChildItem Function:\pnpm -ErrorAction SilentlyContinue
192+
Get-Command pnpm -ErrorAction SilentlyContinue
151193
- name: setup pnpm
152194
## see https://github.com/pnpm/action-setup
153195
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
154196
with:
155197
version: ${{ matrix.pnpm-version }}
198+
- name: test pnpm
199+
run: pnpm --version
156200
- name: install project
157201
run: >
158202
pnpm install

0 commit comments

Comments
 (0)