mirror of
https://github.com/pnpm/action-setup.git
synced 2024-11-12 12:38:05 +00:00
test: add a test about nodejs_bundled
This commit is contained in:
parent
0aabe9da57
commit
c51cc03cc3
59
.github/workflows/test.yaml
vendored
59
.github/workflows/test.yaml
vendored
@ -35,8 +35,8 @@ jobs:
|
||||
- name: 'Test: install'
|
||||
run: pnpm install
|
||||
|
||||
test_explicit_inputs:
|
||||
name: Test with explicit inputs
|
||||
test_dest:
|
||||
name: Test with dest
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
@ -65,6 +65,61 @@ jobs:
|
||||
- name: 'Test: install'
|
||||
run: pnpm install
|
||||
|
||||
test_nodejs_bundled:
|
||||
name: Test with nodejs_bundled
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
|
||||
nodejs_bundled:
|
||||
- true
|
||||
- false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Run the action
|
||||
uses: ./
|
||||
with:
|
||||
version: 7.0.0
|
||||
nodejs_bundled: ${{ matrix.nodejs_bundled }}
|
||||
|
||||
- name: install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
# pnpm@7.0.0 is not compatible with Node.js 12
|
||||
node-version: 12.22.12
|
||||
|
||||
- name: 'Test: which (pnpm)'
|
||||
run: which pnpm
|
||||
|
||||
- name: 'Test: which (pnpx)'
|
||||
if: matrix.nodejs_bundled == false
|
||||
run: which pnpx
|
||||
|
||||
- name: 'Test: install when nodejs_bundled is true'
|
||||
if: matrix.nodejs_bundled
|
||||
run: pnpm install
|
||||
|
||||
- name: 'Test: install when nodejs_bundled is false'
|
||||
if: matrix.nodejs_bundled == false
|
||||
# Since the default shell on windows runner is pwsh, we specify bash explicitly
|
||||
shell: bash
|
||||
run: |
|
||||
if pnpm install; then
|
||||
echo "pnpm install should fail"
|
||||
exit 1
|
||||
else
|
||||
echo "pnpm install failed as expected"
|
||||
fi
|
||||
|
||||
test_run_install:
|
||||
name: 'Test with run_install (${{ matrix.run_install.name }}, ${{ matrix.os }})'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user