This repository has been archived by the owner on Sep 20, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (168 loc) · 5.31 KB
/
push.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: push
permissions: read-all
on: [push, pull_request]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Check out code
uses: actions/checkout@v2
- name: Tidy
run: go mod tidy -compat=1.17
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
skip-pkg-cache: true
skip-build-cache: true
args: --timeout 5m
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Check out code
uses: actions/checkout@v2
- name: Install Dependencies
run: |
sudo add-apt-repository -y ppa:alex-p/tesseract-ocr-devel
sudo apt -y install tesseract-ocr libtesseract-dev libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config upx libx11-dev xorg-dev libxtst-dev libpng++-dev xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev libxkbcommon-dev xsel xclip libasound2-dev
- name: Cache OpenCV
id: cache-opencv
uses: actions/cache@v3
with:
path: /tmp/opencv
key: ${{ runner.os }}-opencv-1
- name: Install OpenCV
run: cd .github && ./build_ubuntu.sh
- name: Tidy
run: go mod tidy -compat=1.17
- name: Test
run: |
mkdir -p frontend/dist/
touch frontend/dist/hello
go test -v ./...
linux:
name: Build (Linux)
runs-on: ubuntu-20.04
needs:
- lint
- test
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Install Dependencies
run: |
sudo add-apt-repository -y ppa:alex-p/tesseract-ocr-devel
sudo apt -y install tesseract-ocr libtesseract-dev libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config upx libx11-dev xorg-dev libxtst-dev libpng++-dev xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev libxkbcommon-dev xsel xclip libasound2-dev
- name: Install pnpm
uses: pnpm/action-setup@v2.2.1
with:
version: 7
run_install: |
- cwd: frontend
- name: Cache OpenCV
id: cache-opencv
uses: actions/cache@v3
with:
path: /tmp/opencv
key: ${{ runner.os }}-opencv-1
- name: Install OpenCV
run: cd .github && ./build_ubuntu.sh
- name: Install Wails
run: |
go install github.com/wailsapp/wails/v2/cmd/wails@latest
wails doctor
- name: Build
run: wails build -v 2 -debug
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: linux
path: build/bin/oshabi
windows:
name: Build (Windows)
runs-on: windows-latest
needs:
- lint
- test
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: >-
git
base-devel
mingw-w64-x86_64-cmake
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-tesseract-ocr
mingw-w64-x86_64-tesseract-data-eng
mingw-w64-x86_64-leptonica
mingw-w64-x86_64-go
mingw-w64-x86_64-nsis
- name: Check out code
uses: actions/checkout@v2
- name: Cache OpenCV
id: cache-opencv
uses: actions/cache@v3
with:
path: C:/opencv
key: ${{ runner.os }}-opencv-1
- name: Install OpenCV
if: steps.cache-opencv.outputs.cache-hit != 'true'
run: cd .github && ./build_windows.cmd
- name: Install OpenCV
if: steps.cache-opencv.outputs.cache-hit == 'true'
run: cd .github && ./install_windows.cmd
- name: Install pnpm
uses: pnpm/action-setup@v2.2.1
with:
version: 7
run_install: |
- cwd: frontend
- name: Build frontend
working-directory: frontend
shell: cmd
run: pnpm run build
- name: Install Wails
run: |
export PATH=/usr/bin
export PATH=$PATH:/bin
export PATH=$PATH:/d/a/_temp/setup-msys2
export PATH=$PATH:/c/opencv/build/bin
export PATH=$PATH:/d/a/_temp/msys64/mingw64/bin
export PATH=$PATH:/d/a/_temp/msys64/mingw64/include
export PATH=$PATH:/c/Users/runneradmin/go/bin
go env
go install github.com/wailsapp/wails/v2/cmd/wails@latest
wails doctor
- name: Build
run: |
export PATH=/usr/bin
export PATH=$PATH:/bin
export PATH=$PATH:/d/a/_temp/setup-msys2
export PATH=$PATH:/c/opencv/build/bin
export PATH=$PATH:/d/a/_temp/msys64/mingw64/bin
export PATH=$PATH:/d/a/_temp/msys64/mingw64/include
export PATH=$PATH:/c/Users/runneradmin/go/bin
wails build -v 2 -s -nsis -debug
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: windows
path: build/bin/oshabi-amd64-installer.exe