diff --git a/.github/workflows/commit-ci.yml b/.github/workflows/commit-ci.yml index 9753ff4de..95bfc6cf4 100644 --- a/.github/workflows/commit-ci.yml +++ b/.github/workflows/commit-ci.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout last commit - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install clang-format run: sudo apt install -y clang-format - name: Lint @@ -30,3 +30,7 @@ jobs: windows: needs: lint uses: ./.github/workflows/windows-build.yml + + docker: + needs: lint + uses: ./.github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 000000000..ee419084e --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,14 @@ +name: Docker build +on: + workflow_call: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout last commit + uses: actions/checkout@v4 + - name: Build with plugins + run: docker build -t librime . diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 5a4284f55..fb74684de 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -16,7 +16,7 @@ jobs: compiler: [g++, clang] steps: - name: Checkout last commit - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ${{ inputs.repository }} submodules: recursive diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 45b8dc4a5..d1c93d9b9 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -21,7 +21,7 @@ jobs: RIME_PLUGINS: ${{ inputs.rime_plugins }} steps: - name: Checkout last commit - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ${{ inputs.repository }} submodules: recursive diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 61eb19cbf..e7f67819b 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -23,7 +23,7 @@ jobs: RIME_PLUGINS: ${{ inputs.rime_plugins }} steps: - name: Checkout last commit - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ${{ inputs.repository }} submodules: recursive @@ -124,7 +124,7 @@ jobs: uses: msys2/setup-msys2@v2 - name: Checkout last commit - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ${{ inputs.repository }} diff --git a/Dockerfile b/Dockerfile index eae3bd452..649617f73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,35 +1,37 @@ -FROM ubuntu:18.04 +FROM debian:12.1 -RUN apt update -RUN apt install -y \ -cmake \ -libboost-dev \ -libboost-filesystem-dev libboost-regex-dev libboost-system-dev libboost-locale-dev \ -libgoogle-glog-dev \ -libgtest-dev \ -libyaml-cpp-dev \ -libleveldb-dev \ -libmarisa-dev +RUN apt update && apt install -y \ + git \ + build-essential \ + cmake \ + ninja-build \ + libboost-dev \ + libboost-filesystem-dev \ + libboost-regex-dev \ + libboost-system-dev \ + libboost-locale-dev \ + libgoogle-glog-dev \ + libgtest-dev \ + libyaml-cpp-dev \ + libleveldb-dev \ + libmarisa-dev \ + libopencc-dev \ + liblua5.4-dev -RUN apt install -y git +COPY / /librime +WORKDIR /librime/plugins +RUN git clone https://github.com/rime/librime-charcode charcode && \ + git clone https://github.com/hchunhui/librime-lua lua && \ + git clone https://github.com/lotem/librime-octagram octagram -# Manually install libopencc -RUN git clone https://github.com/BYVoid/OpenCC.git -WORKDIR OpenCC/ -RUN apt install -y doxygen -RUN make -RUN make install +WORKDIR /librime +RUN cmake -B build -G Ninja \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DENABLE_LOGGING:BOOL=ON \ + -DBUILD_TEST:BOOL=ON \ + -DBUILD_STATIC:BOOL=OFF \ + -DBUILD_SHARED_LIBS:BOOL=ON +RUN cmake --build build -# Fix libgtest problem during compiling -WORKDIR /usr/src/gtest -RUN cmake CMakeLists.txt -RUN make -#copy or symlink libgtest.a and libgtest_main.a to your /usr/lib folder -RUN cp *.a /usr/lib - -# Build librime -WORKDIR / -RUN git clone https://github.com/rime/librime.git -WORKDIR librime/ -RUN make -RUN make install +WORKDIR /librime/build +RUN ctest