Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
force-install: [false, true]
runs-on: ${{ matrix.os }}
env:
SETUP_VP_FORCE_INSTALL: ${{ matrix.force-install }}
steps:
Comment on lines 15 to 20
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

Expand All @@ -32,7 +35,10 @@ jobs:
fail-fast: false
matrix:
node-version: ["22", "24"]
force-install: [false, true]
runs-on: ubuntu-latest
env:
SETUP_VP_FORCE_INSTALL: ${{ matrix.force-install }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

Expand All @@ -54,7 +60,13 @@ jobs:
echo "$ACTUAL" | grep -q "^v${{ matrix.node-version }}\." || (echo "Expected Node.js v${{ matrix.node-version }}.x but got $ACTUAL" && exit 1)

test-cache-pnpm:
strategy:
fail-fast: false
matrix:
force-install: [false, true]
runs-on: ubuntu-latest
env:
SETUP_VP_FORCE_INSTALL: ${{ matrix.force-install }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

Expand All @@ -80,7 +92,13 @@ jobs:
echo "Cache hit: ${{ steps.setup.outputs.cache-hit }}"

test-cache-npm:
strategy:
fail-fast: false
matrix:
force-install: [false, true]
runs-on: ubuntu-latest
env:
SETUP_VP_FORCE_INSTALL: ${{ matrix.force-install }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

Expand All @@ -106,7 +124,13 @@ jobs:
echo "Cache hit: ${{ steps.setup.outputs.cache-hit }}"

test-cache-yarn:
strategy:
fail-fast: false
matrix:
force-install: [false, true]
runs-on: ubuntu-latest
env:
SETUP_VP_FORCE_INSTALL: ${{ matrix.force-install }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

Expand Down Expand Up @@ -136,7 +160,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
force-install: [false, true]
runs-on: ${{ matrix.os }}
env:
SETUP_VP_FORCE_INSTALL: ${{ matrix.force-install }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

Expand All @@ -150,16 +177,15 @@ jobs:
- name: Verify vp exec works
run: vp exec node -e "console.log('vp exec works')"

- name: Verify vp run works (list available scripts)
run: vp run --list
continue-on-error: true

test-vp-install-and-exec:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
force-install: [false, true]
runs-on: ${{ matrix.os }}
env:
SETUP_VP_FORCE_INSTALL: ${{ matrix.force-install }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

Expand Down Expand Up @@ -187,7 +213,13 @@ jobs:
run: vp run hello

test-registry-url:
strategy:
fail-fast: false
matrix:
force-install: [false, true]
runs-on: ubuntu-latest
env:
SETUP_VP_FORCE_INSTALL: ${{ matrix.force-install }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

Expand Down
2 changes: 1 addition & 1 deletion dist/index.mjs

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/cache-vp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ describe("resolveVersion", () => {
});
});

describe("restoreVpCache", () => {
// FIXME: Re-enable these tests after vp CLI caching is re-enabled.
// Caching is temporarily disabled due to Windows `Cannot find module 'which'` issue (#10).
describe.skip("restoreVpCache", () => {
beforeEach(() => {
vi.stubEnv("RUNNER_OS", "Linux");
Comment on lines +86 to 90
vi.stubEnv("HOME", "/home/runner");
Expand Down Expand Up @@ -145,7 +147,9 @@ describe("restoreVpCache", () => {
});
});

describe("saveVpCache", () => {
// FIXME: Re-enable these tests after vp CLI caching is re-enabled.
// Caching is temporarily disabled due to Windows `Cannot find module 'which'` issue (#10).
describe.skip("saveVpCache", () => {
beforeEach(() => {
vi.stubEnv("HOME", "/home/runner");
});
Expand Down
10 changes: 10 additions & 0 deletions src/cache-vp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export async function resolveVersion(versionInput: string): Promise<string | und
}

export async function restoreVpCache(version: string, nodeVersion: string): Promise<boolean> {
// FIXME: Re-enable vp CLI caching after the new version of vite-plus is released
// that fixes the Windows `Cannot find module 'which'` issue (#10).
info("Vp CLI caching is temporarily disabled");
return false;

Comment on lines 34 to +39
const vpHome = getVitePlusHome();
const runnerOS = process.env.RUNNER_OS || platform();
const runnerArch = arch();
Expand All @@ -56,6 +61,11 @@ export async function restoreVpCache(version: string, nodeVersion: string): Prom
}

export async function saveVpCache(): Promise<void> {
// FIXME: Re-enable vp CLI caching after the new version of vite-plus is released
// that fixes the Windows `Cannot find module 'which'` issue (#10).
info("Vp CLI caching is temporarily disabled, skipping save");
return;

Comment on lines 63 to +68
const primaryKey = getState(State.VpCachePrimaryKey);
const matchedKey = getState(State.VpCacheMatchedKey);

Expand Down
4 changes: 2 additions & 2 deletions src/install-viteplus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { DISPLAY_NAME } from "./types.js";
import { resolveVersion, restoreVpCache } from "./cache-vp.js";
import { getVitePlusHome } from "./utils.js";

const INSTALL_URL_SH = "https://staging.viteplus.dev/install.sh";
const INSTALL_URL_PS1 = "https://staging.viteplus.dev/install.ps1";
const INSTALL_URL_SH = "https://viteplus.dev/install.sh";
const INSTALL_URL_PS1 = "https://viteplus.dev/install.ps1";
Comment on lines +9 to +10

export async function installVitePlus(inputs: Inputs, nodeVersion: string): Promise<void> {
const { version } = inputs;
Expand Down
Loading