-
Notifications
You must be signed in to change notification settings - Fork 0
176 lines (150 loc) · 4.73 KB
/
test.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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: test
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
jobs:
windows:
runs-on: windows-latest
strategy:
matrix:
arch: [ x86_64 ]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Download MaaFramework
uses: robinraju/[email protected]
with:
repository: MaaXYZ/MaaFramework
latest: true
fileName: "MAA-win-${{ matrix.arch }}*"
out-file-path: "${{ github.workspace }}/deps"
extract: true
- name: Test
env:
CGO_ENABLED: 1
CGO_CFLAGS: -I${{ github.workspace }}/deps/include
CGO_LDFLAGS: -L${{ github.workspace }}/deps/bin -lMaaFramework -lMaaToolkit
run: |
$env:Path += ";${{ github.workspace }}/deps/bin"
mkdir -p test/data_set/PipelineSmoking/resource/model/ocr
cp -r test/data_set/MaaCommonAssets/OCR/ppocr_v4/zh_cn/* test/data_set/PipelineSmoking/resource/model/ocr
go test -v -tags customenv ./...
- uses: actions/upload-artifact@v4
if: always()
with:
name: MAA-win-${{ matrix.arch }}-text_log
path: "test/debug/*.log"
- uses: actions/upload-artifact@v4
if: always()
with:
name: MAA-win-${{ matrix.arch }}-full_log
path: "test/debug"
ubuntu:
runs-on: ubuntu-latest
container: archlinux:base-devel
strategy:
matrix:
arch: [ x86_64 ]
fail-fast: false
steps:
- name: Update system
run: |
pacman -Syu --noconfirm
- name: Install dep
run: |
pacman -Sy
pacman -S --noconfirm git
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Download MaaFramework
uses: robinraju/[email protected]
with:
repository: MaaXYZ/MaaFramework
latest: true
fileName: "MAA-linux-${{ matrix.arch }}*"
out-file-path: "deps"
extract: true
- name: Test
env:
CGO_CFLAGS: -I/__w/maa-framework-go/maa-framework-go/deps/include
CGO_LDFLAGS: -L/__w/maa-framework-go/maa-framework-go/deps/bin -lMaaFramework -lMaaToolkit
LD_LIBRARY_PATH: /__w/maa-framework-go/maa-framework-go/deps/bin:$LD_LIBRARY_PATH
run: |
mkdir -p test/data_set/PipelineSmoking/resource/model/ocr
cp -r test/data_set/MaaCommonAssets/OCR/ppocr_v4/zh_cn/* test/data_set/PipelineSmoking/resource/model/ocr
go test -v -tags customenv ./...
- uses: actions/upload-artifact@v4
if: always()
with:
name: MAA-linux-${{ matrix.arch }}-text_log
path: "test/debug/*.log"
- uses: actions/upload-artifact@v4
if: always()
with:
name: MAA-linux-${{ matrix.arch }}-full_log
path: "test/debug"
macos:
strategy:
matrix:
include:
- os: macos-13
arch: x86_64
- os: macos-14
arch: aarch64
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install LLVM
run: brew install llvm
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Download MaaFramework
uses: robinraju/[email protected]
with:
repository: MaaXYZ/MaaFramework
latest: true
fileName: "MAA-macos-${{ matrix.arch }}*"
out-file-path: "deps"
extract: true
- name: Test
env:
CGO_CFLAGS: -I${{ github.workspace }}/deps/include
CGO_LDFLAGS: -L${{ github.workspace }}/deps/bin -lMaaFramework -lMaaToolkit
DYLD_LIBRARY_PATH: ${{ github.workspace }}/deps/bin:$DYLD_LIBRARY_PATH
run: |
mkdir -p test/data_set/PipelineSmoking/resource/model/ocr
cp -r test/data_set/MaaCommonAssets/OCR/ppocr_v4/zh_cn/* test/data_set/PipelineSmoking/resource/model/ocr
go test -v -tags customenv ./...
- uses: actions/upload-artifact@v4
if: always()
with:
name: MAA-macos-${{ matrix.arch }}-text_log
path: "test/debug/*.log"
- uses: actions/upload-artifact@v4
if: always()
with:
name: MAA-macos-${{ matrix.arch }}-full_log
path: "test/debug"