Skip to content

Commit b54948a

Browse files
committed
test: Add test package for vite
1 parent 8577aaa commit b54948a

File tree

8 files changed

+1139
-1
lines changed

8 files changed

+1139
-1
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,62 @@ jobs:
150150
- name: "Test package"
151151
run: npm run test:package:rolldown
152152

153+
test-package-vite:
154+
name: "vite v${{ matrix.vite }} / node ${{ matrix.node }} / ${{ matrix.os }}"
155+
needs:
156+
- build
157+
runs-on: ubuntu-latest
158+
strategy:
159+
fail-fast: false
160+
matrix:
161+
node: ["22", "20", "18"]
162+
os: [ubuntu-latest, windows-latest]
163+
vite: ["5", "6", "7"]
164+
exclude:
165+
- os: windows-latest
166+
node: 20
167+
- os: windows-latest
168+
node: 18
169+
- vite: 7
170+
node: 18
171+
172+
steps:
173+
- name: "Checkout repo"
174+
uses: actions/checkout@v4.2.2
175+
176+
- name: "Setup node & npm"
177+
uses: "relative-ci/.github/actions/setup-node-npm@v1.1.0"
178+
with:
179+
cache: "never"
180+
version: ${{ matrix.node }}
181+
install: false
182+
183+
- name: "Install test dependencies"
184+
run: npm install vitest
185+
186+
- name: "Download build files"
187+
uses: actions/download-artifact@v4.3.0
188+
with:
189+
name: build-artifacts
190+
191+
- name: "Setup local npm registry"
192+
run: ./scripts/setup-registry.sh
193+
194+
- name: "Install test package dependencies"
195+
run: |
196+
npm install
197+
npm install vite@${{ matrix.vite }} --force
198+
npx vite -v
199+
working-directory: test/package/vite
200+
201+
- name: "Test package"
202+
run: npm run test:package:vite
203+
153204
tests:
154205
needs:
155206
- test-package-rollup
156207
- test-package-rolldown
208+
- test-package-vite
157209
runs-on: ubuntu-latest
158210
steps:
159211
- run: exit 0

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@
4949
"lint": "eslint .",
5050
"format": "prettier --write .",
5151
"test:unit": "vitest test/unit",
52-
"test:package": "npm run test:package:rolldown && npm run test:package:rollup",
52+
"test:package": "npm run test:package:rolldown && npm run test:package:rollup && npm run test:package:vite",
5353
"test:package:rolldown": "vitest test/package/rolldown",
5454
"test:package:rollup": "vitest test/package/rollup",
55+
"test:package:vite": "vitest test/package/vite",
5556
"bump": "./scripts/bump.sh",
5657
"release": "./scripts/release.sh"
5758
},

test/package/vite/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>rollup-plugin-stats</title>
6+
</head>
7+
<body>
8+
<script type="module" src="./src/index.js"></script>
9+
</body>
10+
</html>

0 commit comments

Comments
 (0)