Skip to content

Commit a22b66e

Browse files
committed
update workflow file
1 parent 006900b commit a22b66e

File tree

1 file changed

+107
-86
lines changed

1 file changed

+107
-86
lines changed

.github/workflows/mozc-ut.yaml

+107-86
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,129 @@
1-
name: Build
1+
name: CI for Windows
2+
# https://github.com/google/mozc/blob/master/docs/build_mozc_in_windows.md
23

3-
on: [push]
4+
# Run on push.
5+
on: push
46

57
permissions: read-all
68

9+
# Prevent previous workflows from running.
710
concurrency:
811
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
912
cancel-in-progress: true
13+
1014
jobs:
11-
build_windows:
12-
runs-on: windows-latest
15+
buildutdic:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
repository: utuhiro78/merge-ut-dictionaries
22+
fetch-depth: 0
23+
24+
- name: setup
25+
working-directory: src/merge
26+
run: |
27+
sed -i -e 's/#generate_latest/generate_latest' make.sh
28+
chmod +x make.sh
29+
30+
- name: build ut dic
31+
working-directory: src/merge
32+
run: |
33+
bash make.sh
34+
35+
- name: Upload Artifacts
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: utdic
39+
retention-days: 1
40+
path: |
41+
src/merge/mozcdic-ut.txt
42+
build:
43+
# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
44+
runs-on: windows-2022
1345
timeout-minutes: 120
46+
needs:
47+
- buildutdic
1448

1549
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v4
18-
with:
19-
repository: google/mozc
20-
submodules: 'recursive'
21-
22-
- name: Checkout
23-
uses: actions/checkout@v4
24-
with:
25-
repository: stm7128/merge-ut-dictionaries-win
26-
path: merge-ut-dictionaries-win
27-
28-
- name: Set up Ruby
29-
uses: ruby/setup-ruby@v1
30-
with:
31-
ruby-version: ruby-head
32-
bundler-cache: true
33-
34-
- name: make UT dic
35-
shell: cmd
36-
working-directory: .\merge-ut-dictionaries-win\src\
37-
run: |
38-
.\make.ps1
39-
Get-Content .\mozcdic-ut.txt >> ..\src\data\dictionary_oss\dictionary00.txt
40-
41-
- name: Set up pip
42-
shell: cmd
43-
working-directory: .\src
44-
run: |
45-
python -m pip install six requests
46-
47-
48-
- name: Try to restore update_deps cache
49-
uses: actions/cache@v4
50-
with:
51-
path: src/third_party_cache
52-
key: update_deps-${{ runner.os }}-${{ hashFiles('src/build_tools/update_deps.py') }}
53-
54-
- name: Install Dependencies
55-
shell: cmd
56-
working-directory: .\src
57-
# This command uses src/third_party_cache as the download cache.
58-
run: |
59-
python build_tools/update_deps.py
60-
61-
62-
- name: Biuld Qt
63-
shell: cmd
64-
working-directory: .\src
65-
run: |
66-
python build_tools/build_qt.py --release --confirm_license
67-
68-
- name: Delete Qt src to save disk space
69-
shell: cmd
70-
working-directory: .\src
71-
run: |
72-
rmdir third_party\qt_src /s /q
73-
74-
- name: gyp
75-
shell: cmd
76-
working-directory: .\src
77-
run: |
78-
python build_mozc.py gyp
79-
80-
- name: build package
81-
shell: cmd
82-
working-directory: .\src
83-
run: |
84-
python build_mozc.py build -c Release package
85-
86-
87-
- name: upload Mozc64.msi
88-
uses: actions/upload-artifact@v4
89-
with:
90-
name: Mozc64.msi
91-
path: src/out_win/Release/Mozc64.msi
92-
if-no-files-found: warn
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
with:
53+
submodules: 'recursive'
54+
55+
- name: Download artifact
56+
uses: actions/download-artifact@v4
57+
with:
58+
name: utdic
59+
60+
- name: patching utdic
61+
shell: bash
62+
run: |
63+
cat mozcdic-ut.txt >> ./src/data/dictionary_oss/dictionary00.txt
64+
65+
- name: Set up pip
66+
shell: cmd
67+
working-directory: .\src
68+
run: |
69+
python -m pip install six requests
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
9383
84+
- name: Build Qt
85+
shell: cmd
86+
working-directory: .\src
87+
run: |
88+
python build_tools/build_qt.py --release --confirm_license
9489
90+
# This is needed only for GitHub Actions where free disk space is quite limited.
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
9596
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+
- name: upload Mozc64.msi
110+
uses: actions/upload-artifact@v4
111+
with:
112+
name: Mozc64.msi
113+
path: src/out_win/Release/Mozc64.msi
114+
if-no-files-found: warn
115+
116+
# actions/cache works without this job, but having this would increase the likelihood of cache hit
117+
# in other jobs. Another approach would be to use "needs:".
118+
# https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow
96119
cache_deps:
97-
# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
98-
runs-on: windows-latest
120+
# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
121+
runs-on: windows-2022
99122
timeout-minutes: 15
123+
100124
steps:
101125
- name: Checkout
102126
uses: actions/checkout@v4
103-
with:
104-
repository: google/mozc
105-
submodules: 'recursive'
106127

107128
- name: Set up pip
108129
shell: cmd

0 commit comments

Comments
 (0)