-
Notifications
You must be signed in to change notification settings - Fork 113
69 lines (63 loc) · 1.94 KB
/
Copy pathruntime.yml
File metadata and controls
69 lines (63 loc) · 1.94 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
name: Runtime Build
on:
workflow_dispatch:
pull_request:
paths:
- "runtime/**"
# Android has its own workflow; don't rebuild the desktop runtime for
# Android-only changes (shared processor/utils/cmake still match above).
- "!runtime/android/**"
- "!runtime/bindings/android/**"
- ".github/workflows/runtime.yml"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Build runtime
run: |
cmake -B build -G Ninja -S runtime -DBUILD_TESTING=ON
cmake --build build --parallel
- uses: actions/setup-python@v5
if: matrix.os == 'ubuntu-latest'
with:
python-version: '3.x'
- name: Install dependencies & Generate TN models
if: matrix.os == 'ubuntu-latest'
run: |
pip install pynini importlib_resources
python -m tn --language zh --overwrite_cache
- name: Run tests
if: matrix.os == 'ubuntu-latest'
run: ctest --test-dir build/test --output-on-failure
build-windows:
name: build (windows-latest)
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
cache: true
install: >-
mingw-w64-x86_64-cmake
mingw-w64-x86_64-gcc
mingw-w64-x86_64-ninja
- name: Build runtime
run: |
cmake --version
gcc --version
# Tests are skipped on Windows: processor_test needs zh_tn_*.fst, which
# are generated via pynini, and pynini has no Windows build.
cmake -S runtime -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF
cmake --build build --parallel