Skip to content

move predict.db to build #34

move predict.db to build

move predict.db to build #34

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
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: |
mkdir build
wget https://github.com/rime/librime-predict/releases/download/data-1.0/predict.txt
wget -O build/release.db https://github.com/rime/librime-predict/releases/download/data-1.0/predict.db
cat predict.txt | ../plugins/predict/bin/build_predict build/predict.db
diff build/{predict,release}.db
- name: Test
working-directory: build/bin
run: |
sed -i '48a \ - predictor' luna_pinyin.schema.yaml
sed -i '37a \ - name: prediction\n states: [ 关闭预测, 开启预测 ]\n reset: 1' luna_pinyin.schema.yaml
echo -e 'nihao \n ' | ./rime_api_console | tee log
grep 'commit: 嗎' log