| 1 |
name: CI |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: |
| 5 |
- master |
| 6 |
pull_request: |
| 7 |
branches: |
| 8 |
- master |
| 9 |
jobs: |
| 10 |
clang-format: |
| 11 |
name: Check clang-format |
| 12 |
runs-on: ubuntu-latest |
| 13 |
container: archlinux:latest |
| 14 |
steps: |
| 15 |
- name: Install dependencies |
| 16 |
run: | |
| 17 |
pacman -Syu --noconfirm git clang diffutils |
| 18 |
git config --global --add safe.directory $GITHUB_WORKSPACE |
| 19 |
- uses: actions/checkout@v4 |
| 20 |
- uses: fcitx/github-actions@clang-format |
| 21 |
check: |
| 22 |
name: Build and test |
| 23 |
needs: clang-format |
| 24 |
runs-on: ubuntu-latest |
| 25 |
container: archlinux:latest |
| 26 |
strategy: |
| 27 |
fail-fast: false |
| 28 |
matrix: |
| 29 |
compiler: [gcc, clang] |
| 30 |
include: |
| 31 |
- compiler: gcc |
| 32 |
cxx_compiler: g++ |
| 33 |
- compiler: clang |
| 34 |
cxx_compiler: clang++ |
| 35 |
env: |
| 36 |
CC: ${{ matrix.compiler }} |
| 37 |
CXX: ${{ matrix.cxx_compiler }} |
| 38 |
steps: |
| 39 |
- name: Install dependencies |
| 40 |
run: | |
| 41 |
pacman -Syu --noconfirm base-devel clang cmake ninja extra-cmake-modules fmt libuv boost boost-libs git qt6-base qt6-wayland libxkbcommon qt6-webengine lua opencc |
| 42 |
- uses: actions/checkout@v4 |
| 43 |
with: |
| 44 |
repository: fcitx/fcitx5 |
| 45 |
path: fcitx5 |
| 46 |
- name: Cache fcitx5 data files |
| 47 |
uses: actions/cache@v4 |
| 48 |
with: |
| 49 |
path: 'fcitx5/**/*.tar.*' |
| 50 |
key: ${{ runner.os }}-${{ hashFiles('fcitx5/src/modules/spell/CMakeLists.txt') |
| 51 |
}} |
| 52 |
- name: Build and Install fcitx5 |
| 53 |
uses: fcitx/github-actions@cmake |
| 54 |
with: |
| 55 |
path: fcitx5 |
| 56 |
cmake-option: >- |
| 57 |
-DENABLE_KEYBOARD=Off -DENABLE_X11=Off -DENABLE_WAYLAND=Off -DENABLE_ENCHANT=Off |
| 58 |
-DENABLE_DBUS=Off -DENABLE_SERVER=Off -DENABLE_EMOJI=Off -DUSE_SYSTEMD=Off |
| 59 |
- uses: actions/checkout@v4 |
| 60 |
with: |
| 61 |
repository: fcitx/libime |
| 62 |
path: libime |
| 63 |
submodules: true |
| 64 |
- name: Cache libime data files |
| 65 |
uses: actions/cache@v4 |
| 66 |
with: |
| 67 |
path: 'libime/**/*.tar.*' |
| 68 |
key: ${{ runner.os }}-${{ hashFiles('libime/data/CMakeLists.txt') }} |
| 69 |
- name: Build and Install libime |
| 70 |
uses: fcitx/github-actions@cmake |
| 71 |
with: |
| 72 |
path: libime |
| 73 |
- uses: actions/checkout@v4 |
| 74 |
with: |
| 75 |
repository: fcitx/fcitx5-lua |
| 76 |
path: fcitx5-lua |
| 77 |
- name: Build and Install fcitx5-lua |
| 78 |
uses: fcitx/github-actions@cmake |
| 79 |
with: |
| 80 |
path: fcitx5-lua |
| 81 |
- uses: actions/checkout@v4 |
| 82 |
with: |
| 83 |
repository: fcitx/fcitx5-qt |
| 84 |
path: fcitx5-qt |
| 85 |
- name: Build and Install fcitx5-qt |
| 86 |
uses: fcitx/github-actions@cmake |
| 87 |
with: |
| 88 |
path: fcitx5-qt |
| 89 |
cmake-option: >- |
| 90 |
-DENABLE_QT4=Off -DENABLE_QT5=Off -DENABLE_QT6=On |
| 91 |
- uses: actions/checkout@v4 |
| 92 |
with: |
| 93 |
path: fcitx5-chinese-addons |
| 94 |
- name: Init CodeQL |
| 95 |
uses: github/codeql-action/init@v3 |
| 96 |
with: |
| 97 |
languages: cpp |
| 98 |
source-root: fcitx5-chinese-addons |
| 99 |
- name: Build and Install fcitx5-chinese-addons |
| 100 |
uses: fcitx/github-actions@cmake |
| 101 |
with: |
| 102 |
path: fcitx5-chinese-addons |
| 103 |
- name: Test |
| 104 |
run: | |
| 105 |
ctest --test-dir fcitx5-chinese-addons/build |
| 106 |
- name: CodeQL Analysis |
| 107 |
uses: github/codeql-action/analyze@v2 |