From 94561ecab9e67993c1f3a7022090eaf7887a2f41 Mon Sep 17 00:00:00 2001 From: zhaozg Date: Sun, 17 Dec 2023 21:05:56 +0800 Subject: [PATCH] add ci --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ profile.lua | 14 +++++++++++--- spec/config_spec.lua | 1 - 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..abade7a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: CI + +on: + push: + branches: [ "master", "ci" ] + tags: + - v?[0-9].[0-9]+.[0-9]+-[0-9]+ + pull_request: + # The branches below must be a subset of the branches above + branches: [ "master" ] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + # os: [macos-latest, ubuntu-latest] + os: [macos-latest] + env: + MACOSX_DEPLOYMENT_TARGET: 10.12 + + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Setup + run: | + brew install luajit + brew install luarocks + wget https://github.com/rime/librime/releases/download/latest/rime-de12d6a-macOS.tar.bz2 + luarocks --lua-dir=/usr/local/opt/luajit install busted + tar xjvf rime-de12d6a-macOS.tar.bz2 + ln -s dist/lib + git clone https://github.com/zhaozg/rime_simp.git var + + - name: Test + run: + ~/.luarocks/bin/busted diff --git a/profile.lua b/profile.lua index 57d857c..1b8d5c8 100644 --- a/profile.lua +++ b/profile.lua @@ -6,14 +6,22 @@ local ffi = require'ffi' if (ffi.os == 'OSX') then traits = { runtimePath = 'lib/librime.1.dylib', - dataPath = os.getenv('HOME') .. - '/Library/Input Methods/Squirrel.app/Contents/SharedSupport', + dataPath = 'var', userPath = 'var/rime', name= "rime-lua", code_name = 'rime-lua', version = '0.0.0' } -else +elseif ffi.os == 'Linux' then + traits = { + runtimePath = 'lib/librime.1.so', + dataPath = 'var', + userPath = 'var/rime', + name= "rime-lua", + code_name = 'rime-lua', + version = '0.0.0' + } +elseif ffi.os == 'Windows' then traits = { runtimePath = [[e:\Totalcmd\Tools\RIME\weasel-0.9.30\rime.dll]], dataPath = [[e:\Totalcmd\Tools\RIME\weasel-0.9.30\data]], diff --git a/spec/config_spec.lua b/spec/config_spec.lua index a829fc3..539c299 100644 --- a/spec/config_spec.lua +++ b/spec/config_spec.lua @@ -23,7 +23,6 @@ describe("config test", function() teardown(function() _ref = _ref - 1 if _ref == 0 then - print('yyy', _ref) rime:finalize() rime = nil end