-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (31 loc) · 910 Bytes
/
test-unit.yml
File metadata and controls
39 lines (31 loc) · 910 Bytes
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
name: Unit Tests (vitest)
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
# Triggers: PR opened, updated (new commits), or reopened
# 1. Runs on remote GitHub Actions server (fresh environment, not local cache)
# 2. Required to pass before PR can be merged to main (enforced by branch protection)
pull_request:
branches: [main]
jobs:
unit:
name: Run Unit Tests
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
# Step: Checkout code
- uses: actions/checkout@v6
# Step: Setup Node.js
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'npm'
# Step: Install dependencies
- name: Install dependencies
run: npm ci
# Step: Run unit tests
- name: Run unit tests
run: npx vitest run