Skip to content

Commit 0ad7523

Browse files
committed
feat(ci): add CI with lint, unit, E2E, and code quality checks
1 parent 09692ad commit 0ad7523

File tree

105 files changed

+3109
-746
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+3109
-746
lines changed

.github/actions/build-rln-node/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ runs:
1212

1313
- name: Install Rust
1414
run: |
15-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
15+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.81.0
1616
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
1717
source "$HOME/.cargo/env"
1818
shell: bash
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Install E2E System Dependencies
2+
description: Install all system dependencies required for E2E GUI testing with Dogtail
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Install required system dependencies
8+
run: |
9+
sudo apt-get update
10+
sudo apt-get install -y \
11+
xvfb \
12+
x11-apps \
13+
xauth \
14+
openbox \
15+
dbus-x11 \
16+
policykit-1-gnome \
17+
lxqt-policykit \
18+
at-spi2-core \
19+
gnome-keyring \
20+
python3-secretstorage \
21+
libatk-bridge2.0-0 \
22+
libxcb-cursor0 \
23+
libxkbcommon-x11-0 \
24+
libxkbcommon0 \
25+
libxcb1 \
26+
libxcb-xinerama0 \
27+
libxcb-xfixes0 \
28+
libxcb-randr0 \
29+
libxcb-icccm4 \
30+
libxcb-image0 \
31+
libxcb-keysyms1 \
32+
libxcb-render-util0 \
33+
libxcb-shape0 \
34+
libxcb-shm0 \
35+
libxcb-glx0 \
36+
libxcb-render0 \
37+
libxcb-present0 \
38+
libxcb-dri3-0 \
39+
libxcb-xinput0 \
40+
libx11-xcb1 \
41+
libxrender1 \
42+
libxcomposite1 \
43+
libxi6 \
44+
libxtst6 \
45+
libxrandr2 \
46+
libxdamage1 \
47+
libxext6 \
48+
libfontconfig1 \
49+
libdrm2 \
50+
libegl1 \
51+
libgl1 \
52+
libopengl0 \
53+
libglu1-mesa \
54+
libglx-mesa0 \
55+
libglvnd0 \
56+
libgles2 \
57+
libgtk-3-0 \
58+
gir1.2-gtk-3.0 \
59+
gir1.2-atspi-2.0 \
60+
python3-gi \
61+
xdg-desktop-portal \
62+
xdg-desktop-portal-gtk \
63+
qt6-gtk-platformtheme \
64+
fonts-dejavu-core \
65+
adwaita-icon-theme \
66+
shared-mime-info \
67+
libgl1-mesa-dri \
68+
mesa-utils \
69+
libgirepository1.0-dev \
70+
meson \
71+
gobject-introspection \
72+
ninja-build \
73+
gsettings-desktop-schemas \
74+
dconf-cli \
75+
dconf-service \
76+
xclip \
77+
wmctrl \
78+
libdbus-1-3 \
79+
libglib2.0-0 \
80+
libnss3 \
81+
libxss1 \
82+
libatk1.0-0 \
83+
libxcb-util1 \
84+
ruby-dev \
85+
build-essential \
86+
libgbm1 \
87+
libosmesa6 \
88+
mesa-utils-extra \
89+
libfuse2 \
90+
scrot \
91+
libcairo2-dev \
92+
pkg-config \
93+
python3-dev
94+
sudo gem install fpm -f
95+
shell: bash
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Generate and Publish Test Reports
2+
description: Generate Allure reports and publish to GitHub Pages with coverage
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Download embedded Allure results
8+
uses: actions/download-artifact@v4
9+
with:
10+
pattern: allure-results-embedded-*
11+
path: allure-results-embedded
12+
merge-multiple: true
13+
14+
- name: Download remote Allure results
15+
uses: actions/download-artifact@v4
16+
with:
17+
pattern: allure-results-remote-*
18+
path: allure-results-remote
19+
merge-multiple: true
20+
21+
- name: Download coverage report
22+
uses: actions/download-artifact@v4
23+
with:
24+
name: coverage-report
25+
path: coverage-report
26+
continue-on-error: true
27+
28+
- name: Setup Java
29+
uses: actions/setup-java@v4
30+
with:
31+
distribution: 'temurin'
32+
java-version: '17'
33+
34+
- name: Install Allure
35+
run: |
36+
curl -o allure-2.24.0.tgz -Ls https://github.com/allure-framework/allure2/releases/download/2.24.0/allure-2.24.0.tgz
37+
tar -zxvf allure-2.24.0.tgz
38+
echo "$PWD/allure-2.24.0/bin" >> $GITHUB_PATH
39+
shell: bash
40+
41+
- name: Generate reports
42+
run: ./.github/scripts/generate-reports.sh
43+
shell: bash
44+
45+
- name: Deploy to GitHub Pages
46+
uses: peaceiris/actions-gh-pages@v4
47+
with:
48+
github_token: ${{ github.token }}
49+
publish_dir: gh-pages
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Setup E2E Test Environment
2+
description: Configure environment for Dogtail GUI automation testing
3+
4+
inputs:
5+
test-file:
6+
description: 'Test file to run'
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Setup E2E environment
13+
run: |
14+
cd src/utils
15+
python generate_config.py
16+
cd ../../
17+
shell: bash
18+
19+
- name: Run E2E test in configured environment
20+
run: |
21+
dbus-run-session -- bash -lc '
22+
mkdir -p "$XDG_RUNTIME_DIR/keyring"
23+
export GNOME_KEYRING_CONTROL="$XDG_RUNTIME_DIR/keyring"
24+
set -euo pipefail
25+
export DISPLAY=:99
26+
export LIBGL_DEBUG=verbose
27+
export MESA_DEBUG=1
28+
export GALLIUM_DRIVER=llvmpipe
29+
export NO_AT_BRIDGE=0
30+
export QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
31+
export QT_ACCESSIBILITY=1
32+
export GTK_MODULES=atk-bridge
33+
export GDK_BACKEND=x11
34+
export QT_QPA_PLATFORM=xcb
35+
export QT_DISABLE_WINDOW_TRANSPARENCY=1
36+
export XLIB_SKIP_ARGB_VISUALS=1
37+
export XDG_CURRENT_DESKTOP=GNOME
38+
export QT_QPA_PLATFORMTHEME=""
39+
export QT_STYLE_OVERRIDE=Fusion
40+
export QT_ENABLE_HIGHDPI_SCALING=0
41+
export QT_OPENGL=software
42+
export QT_XCB_GL_INTEGRATION=none
43+
export QSG_RENDER_LOOP=basic
44+
export QT_AUTO_SCREEN_SCALE_FACTOR=0
45+
export LIBGL_ALWAYS_SOFTWARE=1
46+
export LIBGL_DRI3_DISABLE=1
47+
export QT_X11_NO_MITSHM=1
48+
export QT_SCALE_FACTOR=1
49+
export GVFS_DISABLE_FUSE=1
50+
export GIO_USE_VFS=local
51+
export GTK_CSD=0
52+
export XAUTHORITY="${XAUTHORITY:-$RUNNER_TEMP/.Xauthority}"
53+
export LANG=C.UTF-8
54+
export LC_ALL=C.UTF-8
55+
export APPIMAGE_EXTRACT_AND_RUN=1
56+
export KEYRING_HOME="$RUNNER_TEMP/keyring"
57+
mkdir -p "$KEYRING_HOME"
58+
export PYTHON_KEYRING_BACKEND=keyrings.alt.file.PlaintextKeyring
59+
export PYTHONPATH="$RUNNER_TEMP/pydeps:$PYTHONPATH"
60+
export PYTHONNOUSERSITE=0
61+
export XDG_RUNTIME_DIR="$RUNNER_TEMP/xdg"
62+
mkdir -p "$XDG_RUNTIME_DIR" && chmod 700 "$XDG_RUNTIME_DIR"
63+
export GSETTINGS_BACKEND=dconf
64+
# Start gnome-keyring-daemon and unlock with empty password
65+
eval $(echo -n "" | gnome-keyring-daemon --start --components=secrets,ssh,pkcs11)
66+
export SSH_AUTH_SOCK
67+
68+
# Use direct sudo pass-through to prevent AT-SPI tree breakage
69+
mkdir -p "$RUNNER_TEMP/bin"
70+
cat <<'"'"'PKEXEC_WRAPPER'"'"' > "$RUNNER_TEMP/bin/pkexec"
71+
#!/bin/bash
72+
# Direct pass-through to sudo (GitHub Actions has passwordless sudo)
73+
exec /usr/bin/sudo "$@"
74+
PKEXEC_WRAPPER
75+
chmod +x "$RUNNER_TEMP/bin/pkexec"
76+
export PATH="$RUNNER_TEMP/bin:$PATH"
77+
78+
# Ensure dbus session is available
79+
dbus-update-activation-environment --systemd DISPLAY XAUTHORITY SSH_AUTH_SOCK GNOME_KEYRING_CONTROL GNOME_KEYRING_PID 2>/dev/null || true
80+
# Set accessibility and enable debugging for better AT-SPI stability
81+
gsettings set org.gnome.desktop.interface toolkit-accessibility true 2>/dev/null || true
82+
gsettings set org.gnome.desktop.a11y.applications screen-reader-enabled false 2>/dev/null || true
83+
# Start AT-SPI services and wait for them to initialize (suppress logs)
84+
/usr/libexec/at-spi-bus-launcher --launch-immediately 2>/dev/null &
85+
/usr/libexec/at-spi2-registryd 2>/dev/null &
86+
# Wait for AT-SPI to be fully ready (increased to 18s for reliability on slower runners)
87+
sleep 18
88+
# Verify AT-SPI services are running
89+
pgrep -f "at-spi-bus-launcher" >/dev/null || echo "⚠️ AT-SPI bus launcher not running"
90+
pgrep -f "at-spi2-registryd" >/dev/null || echo "⚠️ AT-SPI registryd not running"
91+
export PATH="$GITHUB_WORKSPACE/ln_node_binary:$PATH"
92+
# Ensure the test password is visible to the AppImage subprocesses
93+
export NATIVE_AUTHENTICATION_PASSWORD="123456"
94+
# Dogtail configuration for CI stability (exported for Python tests)
95+
export DOGTAIL_SEARCH_TIMEOUT=120
96+
export DOGTAIL_SEARCH_BACKOFF=1.5
97+
# Update dbus activation environment with all necessary variables including dogtail config
98+
dbus-update-activation-environment DISPLAY XAUTHORITY QT_ACCESSIBILITY QT_LINUX_ACCESSIBILITY_ALWAYS_ON NO_AT_BRIDGE GTK_MODULES GDK_BACKEND PYTHON_KEYRING_BACKEND KEYRING_HOME APPIMAGE_EXTRACT_AND_RUN PATH DOGTAIL_SEARCH_TIMEOUT DOGTAIL_SEARCH_BACKOFF
99+
export QT_QUICK_BACKEND=software
100+
export QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu --enable-software-rasterizer --in-process-gpu --use-gl=swiftshader --single-process"
101+
export QT_OPENGL=software
102+
export QT_XCB_GL_INTEGRATION=none
103+
export LIBGL_ALWAYS_SOFTWARE=1
104+
export MESA_LOADER_DRIVER_OVERRIDE=llvmpipe
105+
export QTWEBENGINE_DISABLE_SANDBOX=1
106+
export QTWEBENGINE_NO_SANDBOX=1
107+
export QT_DISABLE_WINDOW_TRANSPARENCY=1
108+
export GDK_SYNCHRONIZE=1
109+
export __GLX_VENDOR_LIBRARY_NAME=mesa
110+
sleep 3 # Increased to 3s for better UI stability
111+
poetry run single-test ${{ inputs.test-file }}.py
112+
'
113+
shell: bash

0 commit comments

Comments
 (0)