-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (54 loc) · 1.52 KB
/
vitest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: "Vitest"
on:
push:
branches:
- main
- 'releases/*'
pull_request:
branches:
- main
- 'releases/*'
workflow_dispatch:
jobs:
test-idb-cache:
name: Vitest
runs-on: ubuntu-22.04
steps:
# 1. Checkout the repository
- uses: actions/checkout@v3
# 2. Setup Node.js
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
# 3. Setup pnpm
- name: Setup pnpm
id: setup-pnpm
uses: pnpm/action-setup@v2
with:
version: 7.x
# 4. Cache pnpm dependencies (pnpm store and node_modules)
- name: Cache pnpm dependencies
uses: actions/cache@v3
with:
path: |
~/.pnpm-store
packages/idb-cache/node_modules
key: ${{ runner.os }}-pnpm-store-idb-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-pnpm-${{ steps.setup-pnpm.outputs.pnpm-version }}
restore-keys: |
${{ runner.os }}-pnpm-store-idb-cache-
# 5. Install dependencies
- name: Install dependencies
run: pnpm install
# 6. Run Tests and Save Logs
- name: Run Tests for idb-cache
run: |
mkdir -p logs
pnpm --filter packages/idb-cache test > logs/test-output.log 2>&1 || true
# 7. Upload Test Logs (on failure)
- name: Upload Test Logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: idb-cache-test-logs
path: logs/test-output.log