-
Notifications
You must be signed in to change notification settings - Fork 17
55 lines (47 loc) · 1.62 KB
/
ci.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
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
lint:
runs-on: ubuntu-24.04
steps:
- name: Checkout last commit
uses: actions/checkout@v4
- name: Install clang-format
run: sudo apt install -y clang-format
- name: Lint
run: find src tools -name '*.cc' -o -name '*.h' | xargs clang-format -Werror --dry-run || { echo Please lint your code by '"'"find src tools -name '*.cc' -o -name '*.h' | xargs clang-format -i"'"'.; false; }
build:
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout librime
uses: actions/checkout@v4
with:
repository: rime/librime
- name: Checkout last commit
uses: actions/checkout@v4
with:
path: plugins/predict
- name: Install dependency
run: ./action-install-linux.sh
- name: Build librime with plugin
run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_ASAN=ON
cmake --build build
- name: Build predict.db
working-directory: build/bin
run: |
wget https://github.com/rime/librime-predict/releases/download/data-1.0/predict.txt
wget -O release.db https://github.com/rime/librime-predict/releases/download/data-1.0/predict.db
cat predict.txt | ../plugins/predict/bin/build_predict
diff predict.db release.db
- name: Test
working-directory: build/bin
run: |
cp ../../plugins/predict/data/luna_pinyin.custom.yaml .
echo -e 'nihao \n ' | ./rime_api_console | tee log
grep 'commit: 嗎' log