ci cleanup (#77) #270
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: sudo apt install -y clang-format | |
- name: Lint | |
run: | | |
find include preview src -name '*.mm' -o -name '*.hpp' -o -name '*.cpp' | xargs clang-format -Werror --dry-run | |
build: | |
needs: lint | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-15, macos-13, ubuntu-24.04] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Install node dependencies | |
run: | | |
npm i -g pnpm | |
pnpm i | |
- name: Lint and Check type | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
pnpm run lint | |
pnpm run check | |
- name: Install dependencies (macOS) | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
brew install ninja nlohmann-json | |
- name: Install dependencies (Ubuntu) | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
sudo apt update | |
sudo apt install -y ninja-build \ | |
nlohmann-json3-dev \ | |
libwebkit2gtk-4.1-dev \ | |
libcurl4-openssl-dev | |
# npx playwright install-deps | |
- name: Configure (macOS) | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
cmake -B build -G Ninja \ | |
-DWKWEBVIEW_PROTOCOL="fcitx" \ | |
-DWEBVIEW_WWW_PATH=".local/share/fcitx5/www" \ | |
-DCMAKE_BUILD_TYPE=Release | |
- name: Configure (Ubuntu) | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
cmake -B build -G Ninja \ | |
-DCMAKE_BUILD_TYPE=Release | |
- name: Build | |
run: cmake --build build | |
- name: Test | |
if: startsWith(matrix.os, 'macos') # Ubuntu fails Set layout for 1px | |
run: | | |
npx playwright install webkit | |
pnpm run test | |
- name: Setup tmate session | |
if: ${{ failure() }} | |
uses: mxschmitt/action-tmate@v3 |