-
Notifications
You must be signed in to change notification settings - Fork 6
92 lines (77 loc) · 2.35 KB
/
ci.yml
File metadata and controls
92 lines (77 loc) · 2.35 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: CI
on:
push:
branches: [main]
paths-ignore:
- "*.md"
- "docs/**"
- "pic/**"
- "LICENSE"
- "NOTICE.md"
pull_request:
branches: [main]
jobs:
go-check:
name: Go Build & Test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: wind_input/go.mod
- name: Build wind_input
working-directory: wind_input
run: go build ./...
- name: Vet wind_input
working-directory: wind_input
run: go vet ./...
- name: Test wind_input
working-directory: wind_input
run: go test ./... -v -count=1
- name: Build wind_portable
working-directory: wind_portable
run: dotnet build -c Release
- name: Prepare wind_setting frontend stub
working-directory: wind_setting
run: |
mkdir -p frontend/dist
echo "<!-- CI stub -->" > frontend/dist/index.html
- name: Build wind_setting
working-directory: wind_setting
run: go build ./...
- name: Vet wind_setting
working-directory: wind_setting
run: go vet ./...
# 门控: 仅当 macOS 相关路径改动时才触发昂贵的 macos-14 编译校验 (runner 计费约 10x).
# GitHub 不支持 per-job paths, 故用一个 ubuntu 廉价 job 输出是否命中, macos-check 据此 if 短路.
changes:
name: Detect macOS-related changes
runs-on: ubuntu-latest
outputs:
macos: ${{ steps.filter.outputs.macos }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
macos:
- 'wind_macos/**'
- 'wind_input/**'
# 轻量 macOS 编译校验: 只 swift build + go build, 不打包、不跑 Wails 全量.
macos-check:
name: macOS Build Check
needs: changes
if: needs.changes.outputs.macos == 'true'
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: wind_input/go.mod
- name: Build wind-input-app (Swift IME)
working-directory: wind_macos
run: swift build --product wind-input-app
- name: Build wind_input (Go service, darwin)
working-directory: wind_input
run: go build ./...