|
61 | 61 | with: |
62 | 62 | node-version: ${{ matrix.node-version }} |
63 | 63 | package-manager-cache: false # must not usecaches. we want the latest, always |
| 64 | + - name: bump npm |
| 65 | + shell: bash |
| 66 | + env: |
| 67 | + NODE_VERSION: '${{ matrix.node-version }}' |
| 68 | + run: | |
| 69 | + set -eux |
| 70 | + case "$NODE_VERSION" in |
| 71 | + '26' ) |
| 72 | + npm install -g npm@latest |
| 73 | + ;; |
| 74 | + '24') |
| 75 | + npm i -g npm@^11 |
| 76 | + ;; |
| 77 | + '20' | '20.18.0') |
| 78 | + npm i -g npm@^10 |
| 79 | + ;; |
| 80 | + esac |
| 81 | + npm --version |
64 | 82 | - name: install project |
65 | 83 | run: > |
66 | 84 | npm install |
@@ -102,9 +120,38 @@ jobs: |
102 | 120 | with: |
103 | 121 | node-version: ${{ matrix.node-version }} |
104 | 122 | package-manager-cache: false # must not usecaches. we want the latest, always |
| 123 | + - name: Setup Yarn |
| 124 | + shell: bash |
| 125 | + run: | |
| 126 | + set -eux |
| 127 | + npm uninstall -g yarn |
| 128 | + corepack enable yarn |
| 129 | + case "$NODE_VERSION" in |
| 130 | + '14' | '16') |
| 131 | + corepack prepare --activate yarn@3.8.7 |
| 132 | + ;; |
| 133 | + '18') |
| 134 | + corepack prepare --activate yarn@4.0.0 |
| 135 | + ;; |
| 136 | + *) |
| 137 | + corepack install --global yarn@stable |
| 138 | + ;; |
| 139 | + esac |
| 140 | + yarn --version |
| 141 | + env: |
| 142 | + NODE_VERSION: ${{ matrix.node-version }} |
| 143 | + working-directory: .. # prevent evaluation of package.json |
105 | 144 | - name: install project |
106 | | - run: > |
107 | | - yarn install |
| 145 | + shell: bash |
| 146 | + run: | |
| 147 | + set -eux |
| 148 | + YARN_VERSION=$(yarn --version) |
| 149 | + YARN_MAJOR=${YARN_VERSION%%.*} |
| 150 | + if [ "$YARN_MAJOR" -ge 4 ]; then |
| 151 | + export YARN_ENABLE_HARDENED_MODE=0 |
| 152 | + fi |
| 153 | + yarn install \ |
| 154 | + --no-immutable \ |
108 | 155 | --inline-builds |
109 | 156 | # proven: the package can be installed. that's enough for a meta-package |
110 | 157 | test-pnpm-install: |
@@ -148,11 +195,30 @@ jobs: |
148 | 195 | with: |
149 | 196 | node-version: ${{ matrix.node-version }} |
150 | 197 | package-manager-cache: false # must not usecaches. we want the latest, always |
| 198 | + - name: Remove PNPM from PATH (Windows) |
| 199 | + if: ${{ runner.os == 'Windows' }} |
| 200 | + shell: pwsh |
| 201 | + run: | |
| 202 | + Set-PSDebug -Trace 1 |
| 203 | + # find pnpm |
| 204 | + Get-Alias pnpm -ErrorAction SilentlyContinue |
| 205 | + Get-ChildItem Function:\pnpm -ErrorAction SilentlyContinue |
| 206 | + Get-Command pnpm -ErrorAction SilentlyContinue |
| 207 | + # remove pnpm |
| 208 | + Remove-Item Alias:\pnpm -Verbose -ErrorAction SilentlyContinue |
| 209 | + Remove-Item Function:\pnpm -Verbose -ErrorAction SilentlyContinue |
| 210 | + Remove-Item "C:\npm\prefix\pnpm*" -Verbose -Force -ErrorAction SilentlyContinue |
| 211 | + # verify |
| 212 | + Get-Alias pnpm -ErrorAction SilentlyContinue |
| 213 | + Get-ChildItem Function:\pnpm -ErrorAction SilentlyContinue |
| 214 | + Get-Command pnpm -ErrorAction SilentlyContinue |
151 | 215 | - name: setup pnpm |
152 | 216 | ## see https://github.com/pnpm/action-setup |
153 | 217 | uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 |
154 | 218 | with: |
155 | 219 | version: ${{ matrix.pnpm-version }} |
| 220 | + - name: test pnpm |
| 221 | + run: pnpm --version |
156 | 222 | - name: install project |
157 | 223 | run: > |
158 | 224 | pnpm install |
|
0 commit comments