Skip to content

Commit 678b962

Browse files
committed
feat: fix names, add matrix for ci
1 parent 2f2eec4 commit 678b962

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
runs-on: ${{ matrix.os }}
1215
steps:
1316
- uses: actions/checkout@v5
1417

@@ -38,3 +41,11 @@ jobs:
3841

3942
- name: Run vitest
4043
run: pnpm test --coverage
44+
45+
- name: Upload artifact
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: dist-${{ matrix.os }}
49+
path: |
50+
dist/index-${{ matrix.os }}.node
51+
dist/index-${{ matrix.os }}.d.ts

src/utils/device_type.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ impl DeviceType {
1414
let lower_device_type = s.to_lowercase();
1515
matches!(lower_device_type.as_str(), "phone" | "tablet" | "tv" | "car" | "wearable" | "2in1")
1616
}
17-
DeviceTypeInput::DeviceType(dt) => {
17+
DeviceTypeInput::DeviceType(device_type) => {
1818
// 如果传入的是 DeviceType 枚举,直接返回 true
1919
// 因为如果能够构造出 DeviceType,说明它是有效的
20-
match dt {
20+
match device_type {
2121
DeviceType::Phone | DeviceType::Tablet | DeviceType::Tv | DeviceType::Car | DeviceType::Wearable | DeviceType::TwoInOne => true,
2222
}
2323
}

0 commit comments

Comments
 (0)