test: add strict version-match jobs to reproduce #225 / #227
Test Action / Test with standalone (windows-latest) (push) Has been cancelled
Test Action / Test with default inputs (macos-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with default inputs (ubuntu-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with default inputs (windows-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with dest (macos-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with dest (ubuntu-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with dest (windows-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with standalone (ubuntu-latest) (push) Has been cancelled
Test Action / Test version input is actually installed (10.33.0, macos-latest) (push) Has been cancelled
Test Action / Test version input is actually installed (9.15.5, macos-latest) (push) Has been cancelled
Test Action / Test version input is actually installed (10.33.0, ubuntu-latest) (push) Has been cancelled
Test Action / Test version input is actually installed (9.15.5, ubuntu-latest) (push) Has been cancelled
Test Action / Test version input is actually installed (10.33.0, windows-latest) (push) Has been cancelled
Test Action / Test version input is actually installed (9.15.5, windows-latest) (push) Has been cancelled
Test Action / Test packageManager field is respected (10.33.0, macos-latest) (push) Has been cancelled
Test Action / Test packageManager field is respected (9.15.5, macos-latest) (push) Has been cancelled
Test Action / Test packageManager field is respected (10.33.0, ubuntu-latest) (push) Has been cancelled
Test Action / Test packageManager field is respected (9.15.5, ubuntu-latest) (push) Has been cancelled
Test Action / Test packageManager field is respected (10.33.0, windows-latest) (push) Has been cancelled
Test Action / Test packageManager field is respected (9.15.5, windows-latest) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (macos-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (macos-latest, >=9.15.0) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (ubuntu-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (ubuntu-latest, >=9.15.0) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (windows-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (windows-latest, >=9.15.0) (push) Has been cancelled
Test Action / Test with run_install (global, macos-latest) (push) Has been cancelled
Test Action / Test with run_install (null, macos-latest) (push) Has been cancelled
Test Action / Test with run_install (global, ubuntu-latest) (push) Has been cancelled
Test Action / Test with run_install (null, ubuntu-latest) (push) Has been cancelled
Test Action / Test with run_install (global, windows-latest) (push) Has been cancelled
Test Action / Test with run_install (null, windows-latest) (push) Has been cancelled
Test Action / Test with standalone (windows-latest) (push) Has been cancelled
Test Action / Test with default inputs (macos-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with default inputs (ubuntu-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with default inputs (windows-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with dest (macos-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with dest (ubuntu-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with dest (windows-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with standalone (ubuntu-latest) (push) Has been cancelled
Test Action / Test version input is actually installed (10.33.0, macos-latest) (push) Has been cancelled
Test Action / Test version input is actually installed (9.15.5, macos-latest) (push) Has been cancelled
Test Action / Test version input is actually installed (10.33.0, ubuntu-latest) (push) Has been cancelled
Test Action / Test version input is actually installed (9.15.5, ubuntu-latest) (push) Has been cancelled
Test Action / Test version input is actually installed (10.33.0, windows-latest) (push) Has been cancelled
Test Action / Test version input is actually installed (9.15.5, windows-latest) (push) Has been cancelled
Test Action / Test packageManager field is respected (10.33.0, macos-latest) (push) Has been cancelled
Test Action / Test packageManager field is respected (9.15.5, macos-latest) (push) Has been cancelled
Test Action / Test packageManager field is respected (10.33.0, ubuntu-latest) (push) Has been cancelled
Test Action / Test packageManager field is respected (9.15.5, ubuntu-latest) (push) Has been cancelled
Test Action / Test packageManager field is respected (10.33.0, windows-latest) (push) Has been cancelled
Test Action / Test packageManager field is respected (9.15.5, windows-latest) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (macos-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (macos-latest, >=9.15.0) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (ubuntu-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (ubuntu-latest, >=9.15.0) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (windows-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (windows-latest, >=9.15.0) (push) Has been cancelled
Test Action / Test with run_install (global, macos-latest) (push) Has been cancelled
Test Action / Test with run_install (null, macos-latest) (push) Has been cancelled
Test Action / Test with run_install (global, ubuntu-latest) (push) Has been cancelled
Test Action / Test with run_install (null, ubuntu-latest) (push) Has been cancelled
Test Action / Test with run_install (global, windows-latest) (push) Has been cancelled
Test Action / Test with run_install (null, windows-latest) (push) Has been cancelled
The existing version tests only check output format via regex, which is why the PATH-shadowing bug (#230) slipped through — the bootstrap pnpm's version string matched the regex just as well as the requested version. - test_version_respects_request: runs the action with `version: 9.15.5` and `version: 10.33.0` (both differ from the bootstrap) and asserts that `pnpm --version` matches exactly. Regression test for #225/#230. - test_package_manager_field: writes a `packageManager: pnpm@<v>` entry into package.json, runs the action with no `version:` input, and asserts exact match. Reproduces #227; currently expected to fail since `packageManager` extraction was intentionally not added.
This commit is contained in:
@@ -129,6 +129,82 @@ jobs:
|
||||
pnpm add is-odd
|
||||
shell: bash
|
||||
|
||||
test_version_respects_request:
|
||||
name: 'Test version input is actually installed (${{ matrix.version }}, ${{ matrix.os }})'
|
||||
# Regression test for #225 / #230: the bootstrap pnpm on PATH was shadowing the self-updated binary,
|
||||
# so a user requesting e.g. `version: 9.15.5` would silently get the bootstrap version.
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
version:
|
||||
- '9.15.5'
|
||||
- '10.33.0'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||
|
||||
- name: Run the action
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
|
||||
- name: 'Test: exact version installed'
|
||||
run: |
|
||||
required='${{ matrix.version }}'
|
||||
actual="$(pnpm --version)"
|
||||
echo "pnpm version: ${actual}"
|
||||
if [ "${actual}" != "${required}" ]; then
|
||||
echo "Expected pnpm version ${required}, but got ${actual}"
|
||||
exit 1
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
test_package_manager_field:
|
||||
name: 'Test packageManager field is respected (${{ matrix.version }}, ${{ matrix.os }})'
|
||||
# Reproduces #227: when `packageManager` is set in package.json and no `version:` input is given,
|
||||
# the action should install the version specified there.
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
version:
|
||||
- '9.15.5'
|
||||
- '10.33.0'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||
|
||||
- name: Set up package.json with packageManager field
|
||||
run: echo '{"packageManager":"pnpm@${{ matrix.version }}"}' > package.json
|
||||
shell: bash
|
||||
|
||||
- name: Run the action
|
||||
uses: ./
|
||||
|
||||
- name: 'Test: exact version installed'
|
||||
run: |
|
||||
required='${{ matrix.version }}'
|
||||
actual="$(pnpm --version)"
|
||||
echo "pnpm version: ${actual}"
|
||||
if [ "${actual}" != "${required}" ]; then
|
||||
echo "Expected pnpm version ${required}, but got ${actual}"
|
||||
exit 1
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
test_dev_engines:
|
||||
name: Test with devEngines.packageManager
|
||||
|
||||
|
||||
Reference in New Issue
Block a user