Skip to content

Commit f187c23

Browse files
committed
add workflow file
1 parent 90b3194 commit f187c23

File tree

1 file changed

+190
-0
lines changed

1 file changed

+190
-0
lines changed

.github/workflows/mozc-ut.yaml

+190
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
name: Build
2+
3+
on: [push]
4+
5+
permissions: read-all
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
build_linux:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
repository: utuhiro78/merge-ut-dictionaries
20+
21+
# Linuxでファイルを生成するステップを追加
22+
- name: Setup
23+
run: |
24+
sudo apt update
25+
sudo apt install ruby
26+
27+
- name: Build UT dict
28+
working-directory: ./src
29+
run: |
30+
sed -i 's/#alt_cannadic/alt_cannadic/' ./make.sh
31+
sed -i 's/#neologd/neologd/' ./make.sh
32+
bash ./make.sh
33+
sed -i 's/\n/\r\n/g' mozcdic-ut.txt
34+
35+
- name: Upload artifact
36+
uses: actions/upload-artifact@v2
37+
with:
38+
name: mozcdic-ut
39+
path: mozcdic-ut.txt
40+
41+
build_windows:
42+
runs-on: windows-latest
43+
timeout-minutes: 120
44+
needs: build_linux
45+
46+
steps:
47+
- name: Download artifact
48+
uses: actions/download-artifact@v2
49+
with:
50+
name: mozcdic-ut
51+
path: .
52+
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
with:
56+
repository: google/mozc
57+
submodules: 'recursive'
58+
59+
- name: Set up pip
60+
shell: cmd
61+
working-directory: .\src
62+
run: |
63+
python -m pip install six requests
64+
65+
- name: Set up pip
66+
shell: powershell
67+
run: |
68+
Get-Content mozcdic-ut.txt >> .\src\data\dictionary_oss\dictionary00.txt
69+
70+
71+
- name: Try to restore update_deps cache
72+
uses: actions/cache@v4
73+
with:
74+
path: src/third_party_cache
75+
key: update_deps-${{ runner.os }}-${{ hashFiles('src/build_tools/update_deps.py') }}
76+
77+
- name: Install Dependencies
78+
shell: cmd
79+
working-directory: .\src
80+
# This command uses src/third_party_cache as the download cache.
81+
run: |
82+
python build_tools/update_deps.py
83+
84+
85+
- name: Biuld Qt
86+
shell: cmd
87+
working-directory: .\src
88+
run: |
89+
python build_tools/build_qt.py --release --confirm_license
90+
91+
- name: Delete Qt src to save disk space
92+
shell: cmd
93+
working-directory: .\src
94+
run: |
95+
rmdir third_party\qt_src /s /q
96+
97+
- name: gyp
98+
shell: cmd
99+
working-directory: .\src
100+
run: |
101+
python build_mozc.py gyp
102+
103+
- name: build package
104+
shell: cmd
105+
working-directory: .\src
106+
run: |
107+
python build_mozc.py build -c Release package
108+
109+
110+
- name: upload Mozc64.msi
111+
uses: actions/upload-artifact@v4
112+
with:
113+
name: Mozc64.msi
114+
path: src/out_win/Release/Mozc64.msi
115+
if-no-files-found: warn
116+
117+
test:
118+
# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
119+
runs-on: windows-2022
120+
timeout-minutes: 90
121+
122+
- name: Checkout
123+
uses: actions/checkout@v4
124+
with:
125+
repository: google/mozc
126+
submodules: 'recursive'
127+
128+
- name: Set up pip
129+
shell: cmd
130+
working-directory: .\src
131+
run: |
132+
python -m pip install six requests
133+
134+
- name: Try to restore update_deps cache
135+
uses: actions/cache@v4
136+
with:
137+
path: src/third_party_cache
138+
key: update_deps-${{ runner.os }}-${{ hashFiles('src/build_tools/update_deps.py') }}
139+
140+
- name: Install Dependencies
141+
shell: cmd
142+
working-directory: .\src
143+
# This command uses src/third_party_cache as the download cache.
144+
run: |
145+
python build_tools/update_deps.py
146+
147+
- name: gyp
148+
shell: cmd
149+
working-directory: .\src
150+
run: |
151+
python build_mozc.py gyp --noqt --msvs_version=2022
152+
153+
- name: runtests
154+
shell: cmd
155+
working-directory: .\src
156+
run: |
157+
python build_mozc.py runtests -c Debug
158+
159+
# actions/cache works without this job, but having this would increase the likelihood of cache hit
160+
# in other jobs. Another approach would be to use "needs:".
161+
# https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow
162+
cache_deps:
163+
# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
164+
runs-on: windows-latest
165+
timeout-minutes: 15
166+
167+
- name: Checkout
168+
uses: actions/checkout@v4
169+
with:
170+
repository: google/mozc
171+
submodules: 'recursive'
172+
173+
- name: Set up pip
174+
shell: cmd
175+
working-directory: .\src
176+
run: |
177+
python -m pip install requests
178+
179+
- name: Try to restore update_deps cache
180+
uses: actions/cache@v4
181+
with:
182+
path: src/third_party_cache
183+
key: update_deps-${{ runner.os }}-${{ hashFiles('src/build_tools/update_deps.py') }}
184+
185+
- name: Install Dependencies
186+
shell: cmd
187+
working-directory: .\src
188+
# This command uses src/third_party_cache as the download cache.
189+
run: |
190+
python build_tools/update_deps.py --cache_only

0 commit comments

Comments
 (0)