Skip to content

Commit

Permalink
Automation test
Browse files Browse the repository at this point in the history
  • Loading branch information
wengxt committed Oct 4, 2024
1 parent ec45508 commit c5bdcb2
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 3 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/moze-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: "0 13 * * *"

jobs:
update:
name: Build and test
runs-on: ubuntu-latest
container: archlinux:latest
strategy:
fail-fast: false
steps:
- name: Setup User
run: |
useradd -m builduser
- name: Install dependencies
run: |
pacman -Syu --noconfirm base-devel clang cmake ninja extra-cmake-modules fmt libuv boost git qt6-base qt6-wayland libxkbcommon qt6-webengine flatpak procps-ng python3 yq wget git qemu-user-static-binfmt
/usr/lib/systemd/systemd-binfmt
flatpak install -y --system org.freedesktop.Sdk/aarch64/23.08
- uses: actions/checkout@v4
with:
repository: fcitx/fcitx5
path: fcitx5
- name: Cache fcitx5 data files
uses: actions/cache@v4
with:
path: 'fcitx5/**/*.tar.*'
key: ${{ runner.os }}-${{ hashFiles('fcitx5/src/modules/spell/CMakeLists.txt') }}
- name: Build and Install fcitx5
uses: fcitx/github-actions@cmake
with:
path: fcitx5
cmake-option: >-
-DENABLE_KEYBOARD=Off -DENABLE_X11=Off -DENABLE_WAYLAND=Off -DENABLE_ENCHANT=Off
-DENABLE_DBUS=Off -DENABLE_SERVER=Off -DENABLE_EMOJI=Off -DUSE_SYSTEMD=Off
install-prefix: /usr
- uses: actions/checkout@v4
with:
path: flatpak-fcitx5
submodules: true
- name: Update
run: |
cd flatpak-fcitx5
chown -R builduser:builduser .
sudo -u builduser ./update_mozc_deps
git diff
chown -R root:root .
8 changes: 5 additions & 3 deletions update_mozc_deps
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,22 @@ check_and_download_bazel() {
local BAZEL_URL=`yq -r '.sources[].url | select(contains("'$1'"))' "$SCRIPT_DIRECTORY/modules/bazel.yaml"`
FILENAME="$(basename "$BAZEL_URL")"
if [ -f "bazel-$1" ]; then
chmod +x bazel-$1
if check_bazel_binary $1 ; then
return 0
else
rm -f "bazel-$1"
fi
fi
wget -O bazel-$1 ${BAZEL_URL}
wget -nv -O bazel-$1 ${BAZEL_URL}
chmod +x bazel-$1
check_bazel_binary $1
return $?
}

run_bazel() {
echo $1 clean --expunge
$1 clean --expunge
# $1 clean --expunge
echo $1 build --nobuild --experimental_downloader_config="$SCRIPT_DIRECTORY/downloader.cfg" --registry=file://$BASE/bcr --repository_cache="$_MOZC_BAZEL_CACHE" --config oss_linux --config release_build $2
$1 build --nobuild --experimental_downloader_config="$SCRIPT_DIRECTORY/downloader.cfg" --registry=file://$BASE/bcr --repository_cache="$_MOZC_BAZEL_CACHE" --config oss_linux --config release_build $2
}
Expand Down Expand Up @@ -88,7 +90,7 @@ BUILD_TARGET="unix/fcitx5:fcitx5-mozc.so ${BUILD_TARGET_SERVER} gui/tool:mozc_to
run_bazel "$BASE/bazel-x86_64" $BUILD_TARGET
# Only run aarch64 against server target, as with flatpak we have no external dependencies
# TODO: apply only tag for deps
run_bazel "flatpak run --filesystem=home --share=network --command=$BASE/bazel-arm64 org.freedesktop.Sdk/aarch64/23.08" $BUILD_TARGET_SERVER
run_bazel "flatpak run --filesystem=$PWD --filesystem=home --share=network --command=$BASE/bazel-arm64 org.freedesktop.Sdk/aarch64/23.08" $BUILD_TARGET_SERVER

kill $PROXY_PID

Expand Down

0 comments on commit c5bdcb2

Please sign in to comment.