| 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 libpinyin |
| 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 |
path: fcitx5-zhuyin |
| 62 |
- name: Init CodeQL |
| 63 |
uses: github/codeql-action/init@v3 |
| 64 |
with: |
| 65 |
languages: cpp |
| 66 |
source-root: fcitx5-zhuyin |
| 67 |
- name: Build and Install fcitx5-zhuyin |
| 68 |
uses: fcitx/github-actions@cmake |
| 69 |
with: |
| 70 |
path: fcitx5-zhuyin |
| 71 |
- name: Test |
| 72 |
run: | |
| 73 |
ctest --test-dir fcitx5-zhuyin/build |
| 74 |
- name: CodeQL Analysis |
| 75 |
uses: github/codeql-action/analyze@v2 |