mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-04 19:27:55 +00:00
* WIP: Haskell impl of resizeImageToStrSize * WIP: add FFI export wrapper * WIP: switch ios resizeImageToStrSizeSync to backend * WIP: fix resizeImageToStrSizeSync * WIP: add JNI wrappers * Add non-base64 resize and cWriteImage * WIP: add chat_write_image * fix resizeToStr * fixes * fix syntax, raise jpeg quality back * add chatWriteImage * Fix cfArgs in tests * Use jpeg-turbo encoder * add nix pins * bump jpeg-turbo * add CI deps * add encoding funs to android lib * bump jpeg-turbo for 20.04 fix * jpeg-turbo fix for 8.10 * android fixes * Bump jpeg-turbo * set static flag for jpeg-turbo * Fix nix for aarch64/android * Fix android C api * Fix resize in android * Bump hs-libjpeg-turbo * target correct override * override android lib from android pkgs * add macos build tweaks * bump hs-jpeg-turbo for 8.10 fixes * more build fixes * make ios compile * Always use pkgconfig for libjpeg-turbo * WIP: debug libjpeg in ubuntu pkg-config CI * Add pkg-config to dockerfiles * Add libturbojpeg to dockerfiles * Use -dev version of libturbojpeg in dockerfiles * Install pkg-config in windows CI * Disable flag for custom libturbojpeg linking options Workarounds relocation error on x86_64-linux with gcc: /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/libturbojpeg.a(turbojpeg.c.o): relocation R_X86_64_TPOFF32 against `errStr' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: failed to set dynamic section sizes: bad value * WIP: debug libjpeg in windows pkg-config CI * WIP: debug libjpeg package in windows CI * core: image resize module and buffer FFI * ci: link libjpeg-turbo statically on all platforms * ui: resize images in the core * core: rename image resize functions to chat_resize_image and chat_resize_image_uri * ci: restore whitespace in build.yml * ci: build libjpeg-turbo 3.1.4.1 from a submodule * core: hs-jpeg-turbo from github.com/simplex-chat * nodejs: resize images * python: resize images * core: hs-jpeg-turbo from gitlab.com, the GitHub import lacks LFS objects * core: generate /img previews * ci: link libjpeg-turbo on Windows without pkg-config * ci: build libjpeg-turbo on Windows with the GHC toolchain * docs: plan for image resizing in the core * docs: update image resizing plan * ios: prevent crash when wallpaper image cannot be resized * android, desktop: raise an error when an image cannot be resized * docs: update spec references for image resizing * docker: build the CLI image from a clone without submodules * docs: apply review fixes to image resizing plan * docker: build the CLI from a git worktree with the submodule present * docs: apply second review to image resizing plan * docs: point image resizing plan at the rewritten commit * core: choose image format by transparency in chat_resize_image * nodejs: resize images to the app sizes * python: resize images to the app sizes * nodejs, python: describe the core modules as used for image resizing * docs: add license notices of the image libraries * ci: describe the avatar method without attributing it to the apps * ci, ios, nix: remove the libjpeg-turbo build outside cabal * python: name resize_image in the core module text * nodejs, python: describe resizing to the app image sizes * core: refuse images larger than the supported size * core: resize to JPEG images with a side above 65500 pixels * docs: record image resizing decisions for the bundled libjpeg-turbo * core, docs: build libjpeg-turbo and stb from the fork submodules * docs: record the fork pins in the image resizing plan * core: resize images to at most 4320 pixels per side, refuse above 16384 * docs: record the image side limits in the image resizing plan * core: pin the rebased hs-jpeg-turbo fork * core: pin the hs-jpeg-turbo fork without package.yaml * docs: plan scaled JPEG decoding and EXIF orientation of images * docs: copy the JuicyPixels-stbir licence of the pinned fork * core: pin the hs-jpeg-turbo fork with scaled JPEG decoding * core: decode JPEG at the display size, up to 65500 pixels per side * core: rotate JPEG images by their EXIF orientation * docs: refer the image plan to the JPEG decoding code * docs: record the approved image processing decisions * core: limit JPEG decoding memory to 1024 MB outside iOS and Android * docs: name JPEG decoding in the libjpeg-turbo notice * docs: plan image resizing from files and the decisions of 26 Oct * core: scale images in one Catmull-Rom pass with sharpening * docs: plan image sizes at a fixed quality * core: resize images at a fixed quality to fill the size limit * core: resize images from a file path or a file descriptor * ios, android, desktop: resize picked images from their files * core: encode resized images with mozjpeg * tests: check descriptor closing by the file it refers to * core: raise JPEG quality only for a full-size image below 97% of the limit * ci: name the mozjpeg submodule in the Windows cleanup comments * docs: refer the image plan to the current code * docs: refer the image plan to the code merged with master * core: export every image resizing function from each library * core: close the file descriptor when its handle cannot be created * docs: count the C sources of mozjpeg with the arithmetic decoder * core: use the reviewed hs-jpeg-turbo and JuicyPixels-stbir forks * ci: build the armv7a Android core library on request * core: round image heights half up in the size search * ios: describe the file image resizing functions in SimpleX.h * ci: pick, preview and send images in the Claude app tests * core: decode PNG images with libspng and refuse other formats * core: encode PNG with libspng, keeping the smaller filter choice * ci: pick, preview and send images in the scripted app smoke tests * flake: build the PNG decoder package in nix builds * ios: remove the copy of a picked image after sending it * core: refuse image files larger than the decode memory limit * core: scale a JPEG image to its largest size once per resize * core: bisect JPEG quality without a step function * core: reduce the memory used to sharpen and to decode PNG images * android, desktop: pass the image format to the core as an integer * android, desktop: fuse the preview conditions of picked media * android, desktop, ci: check that the core resized the smoke test images * python: remove the docstrings of the explicit image resizing functions * docs: add the second review fixes to the image plan * ci: tap the iOS attachment button by its accessibility label * core: keep the colour profiles of resized images * docs: add the colour profiles to the image plan * ci: wait up to 30 s for the new group screens in the iOS smoke test * ci: pick the Android smoke test images from their own photo folders * ci: tap the iOS photo picker by position, as its tree is not shown * ci: pick the test card and the logo by their iOS picker positions * core: update JuicyPixels-stbir with the stb_image_resize licence terms * core: write a fixed Display P3 profile for Display P3 images only * core: do not keep the input image in memory for its colour profile * core: read the JPEG segments once for the orientation and the profile * core: read an image file into one buffer of its size * docs: add the third review fixes to the image plan * core: resize images with Display P3 or no profile, not profile bytes * ci: check the pixel sizes of the images sent in the iOS smoke test * core: update hs-jpeg-turbo with PNG chunk limits and encoder fixes * docs: list Compact ICC Profiles, libspng and miniz in the dependencies * android, desktop: reword the picked media preview comment * docs: refer the image plan to the code merged with master * ci: render the iOS snapshots before the images case * ci: dismiss the snapshot tests' camera alert before the iOS images case * core: update hs-jpeg-turbo with tests and the JuicyPixels-spng synopsis * core: pin hs-jpeg-turbo and JuicyPixels-stbir in simplex-chat repositories * update ios core library * core, ui: accept only JPEG and PNG image data * core: update JuicyPixels-stbir * docs: plan for the iOS copy of picked images --------- Co-authored-by: IC Rainbow <aenor.realm@gmail.com> Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com> Co-authored-by: Alexandre Esteves <alexfmpe@proton.me>
490 lines
18 KiB
YAML
490 lines
18 KiB
YAML
name: desktop-linux
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
claude:
|
|
description: Also run the Claude job, which spends the Claude subscription's usage limits
|
|
type: boolean
|
|
default: false
|
|
backend:
|
|
description: Also start the test backend
|
|
type: boolean
|
|
default: false
|
|
release:
|
|
description: Also test the latest released app, to tell a branch's failure from the runner's
|
|
type: boolean
|
|
default: false
|
|
|
|
permissions:
|
|
contents: read
|
|
actions: read
|
|
|
|
concurrency:
|
|
group: desktop-linux-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
GHC_VER: 9.6.3
|
|
CABAL_VER: 3.10.2.0
|
|
JAVA_VER: 17
|
|
CORE_PKG: desktop-core-linux-x86_64.tar.gz
|
|
BACKEND_PKG: desktop-linux-backend.tar.gz
|
|
|
|
jobs:
|
|
plan:
|
|
name: choose jobs, find earlier builds
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 10
|
|
outputs:
|
|
run-claude: ${{ steps.jobs.outputs.claude }}
|
|
run-backend: ${{ steps.jobs.outputs.backend }}
|
|
run-release: ${{ steps.jobs.outputs.release }}
|
|
claude-backend: ${{ steps.scope.outputs.backend }}
|
|
core: ${{ steps.names.outputs.core }}
|
|
core-run: ${{ steps.core.outputs.run-id }}
|
|
backend: ${{ steps.names.outputs.backend }}
|
|
backend-run: ${{ steps.backend.outputs.run-id }}
|
|
steps:
|
|
- name: Choose jobs
|
|
id: jobs
|
|
env:
|
|
CLAUDE: ${{ inputs.claude }}
|
|
BACKEND: ${{ inputs.backend }}
|
|
RELEASE: ${{ inputs.release }}
|
|
run: |
|
|
echo "claude=$CLAUDE" | tee -a "$GITHUB_OUTPUT"
|
|
echo "backend=$BACKEND" | tee -a "$GITHUB_OUTPUT"
|
|
echo "release=$RELEASE" | tee -a "$GITHUB_OUTPUT"
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Claude scope
|
|
id: scope
|
|
if: steps.jobs.outputs.claude == 'true'
|
|
env:
|
|
BACKEND: ${{ steps.jobs.outputs.backend }}
|
|
run: |
|
|
backend=$(sed -n 's/^backend: *//p' scripts/ci/desktop-linux/claude-scope)
|
|
case "$backend" in
|
|
yes | no) echo "backend=$backend" | tee -a "$GITHUB_OUTPUT" ;;
|
|
*)
|
|
echo "::error::claude-scope must say backend: yes or backend: no"
|
|
exit 1
|
|
;;
|
|
esac
|
|
if [ "$backend" = yes ] && [ "$BACKEND" != true ]; then
|
|
echo "::error::claude-scope says the Claude session uses the test backend: ask for it too"
|
|
exit 1
|
|
fi
|
|
|
|
# artifacts are named after the sources they are built from, so a run uses one that an earlier run uploaded
|
|
- name: Artifact names
|
|
id: names
|
|
run: |
|
|
echo "core=desktop-linux-core-${{ hashFiles('src/**', 'cabal.project', 'simplex-chat.cabal', 'PRIVACY.md', 'scripts/desktop/build-lib-linux.sh', 'scripts/ci/desktop-linux/build-core.sh') }}" >> "$GITHUB_OUTPUT"
|
|
echo "backend=desktop-linux-backend-${{ hashFiles('src/**', 'apps/simplex-chat/**', 'apps/simplex-directory-service/Main.hs', 'apps/simplex-directory-service/src/**', 'cabal.project', 'simplex-chat.cabal', 'scripts/ci/desktop-linux/build-backend.sh') }}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Find core library
|
|
id: core
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: scripts/ci/desktop-linux/earlier-run.sh "${{ steps.names.outputs.core }}"
|
|
|
|
- name: Find backend
|
|
id: backend
|
|
if: steps.jobs.outputs.backend == 'true'
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: scripts/ci/desktop-linux/earlier-run.sh "${{ steps.names.outputs.backend }}"
|
|
|
|
backend:
|
|
name: test backend for the app
|
|
needs: plan
|
|
if: needs.plan.outputs.run-backend == 'true' && needs.plan.outputs.backend-run == ''
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 150
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Show runner
|
|
run: |
|
|
lsb_release -ds
|
|
nproc
|
|
free -h
|
|
df -h /
|
|
|
|
- name: Setup Haskell
|
|
uses: simplex-chat/setup-haskell-action@v2
|
|
with:
|
|
ghc-version: ${{ env.GHC_VER }}
|
|
cabal-version: ${{ env.CABAL_VER }}
|
|
|
|
- name: Install libraries
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libffi-dev libgmp-dev libnuma-dev libssl-dev zlib1g-dev
|
|
|
|
- name: Build backend
|
|
run: scripts/ci/desktop-linux/build-backend.sh ~/backend/${{ env.BACKEND_PKG }}
|
|
|
|
- name: Upload backend
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: ${{ needs.plan.outputs.backend }}
|
|
path: ~/backend/${{ env.BACKEND_PKG }}
|
|
compression-level: 0
|
|
retention-days: 30
|
|
if-no-files-found: error
|
|
|
|
core:
|
|
name: core library for Linux
|
|
needs: plan
|
|
if: needs.plan.outputs.core-run == ''
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 150
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Show runner
|
|
run: |
|
|
lsb_release -ds
|
|
nproc
|
|
free -h
|
|
df -h /
|
|
|
|
- name: Setup Haskell
|
|
uses: simplex-chat/setup-haskell-action@v2
|
|
with:
|
|
ghc-version: ${{ env.GHC_VER }}
|
|
cabal-version: ${{ env.CABAL_VER }}
|
|
|
|
- name: Install libraries
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libffi-dev libgmp-dev libnuma-dev libssl-dev zlib1g-dev patchelf
|
|
|
|
- name: Build core library
|
|
run: scripts/ci/desktop-linux/build-core.sh ~/core/${{ env.CORE_PKG }}
|
|
|
|
- name: Upload core library
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: ${{ needs.plan.outputs.core }}
|
|
path: ~/core/${{ env.CORE_PKG }}
|
|
compression-level: 0
|
|
retention-days: 30
|
|
if-no-files-found: error
|
|
|
|
app:
|
|
name: desktop app under Xvfb
|
|
needs: [plan, core, backend]
|
|
# core and backend are skipped when an earlier run built them, and backend also when the run doesn't start it
|
|
if: ${{ !cancelled() && !failure() && needs.plan.result == 'success' && needs.core.result != 'cancelled' && needs.backend.result != 'cancelled' }}
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 60
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Show runner
|
|
run: |
|
|
lsb_release -ds
|
|
nproc
|
|
free -h
|
|
df -h /
|
|
echo "ANDROID_HOME=$ANDROID_HOME"
|
|
ls "$ANDROID_HOME/platforms" "$ANDROID_HOME/build-tools" || true
|
|
|
|
- name: Install tools
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y xvfb xdotool openbox imagemagick tesseract-ocr sqlite3 fonts-dejavu-core
|
|
dpkg-query -W xvfb xdotool openbox imagemagick tesseract-ocr sqlite3 fonts-dejavu-core
|
|
|
|
- name: Download core library
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: ${{ needs.plan.outputs.core }}
|
|
path: ~/core
|
|
run-id: ${{ needs.plan.outputs.core-run || github.run_id }}
|
|
github-token: ${{ github.token }}
|
|
|
|
- name: Install core library
|
|
id: core
|
|
run: scripts/ci/desktop-linux/install-core.sh ~/core/${{ env.CORE_PKG }}
|
|
|
|
- name: Download backend
|
|
if: needs.plan.outputs.run-backend == 'true'
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: ${{ needs.plan.outputs.backend }}
|
|
path: ~/backend
|
|
run-id: ${{ needs.plan.outputs.backend-run || github.run_id }}
|
|
github-token: ${{ github.token }}
|
|
|
|
- name: Start test backend
|
|
id: backend
|
|
if: needs.plan.outputs.run-backend == 'true'
|
|
timeout-minutes: 30
|
|
run: scripts/ci/desktop-linux/backend.sh start ~/backend/${{ env.BACKEND_PKG }} "$RUNNER_TEMP/backend"
|
|
|
|
# the app and its tests are still built when the backend fails
|
|
- name: Setup Java
|
|
if: ${{ !cancelled() && steps.core.outcome == 'success' }}
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: corretto
|
|
java-version: ${{ env.JAVA_VER }}
|
|
|
|
# the Kotlin compiler daemon otherwise gets gradle.properties' 2 GB, which compiling :common runs out of
|
|
- name: Build app
|
|
id: build
|
|
if: ${{ !cancelled() && steps.core.outcome == 'success' }}
|
|
working-directory: apps/multiplatform
|
|
run: |
|
|
./gradlew --no-daemon --console=plain -Psimplex.assets.dir=../../assets -Pkotlin.daemon.jvmargs=-Xmx4g :desktop:createDistributable
|
|
app=release/main/app/simplex
|
|
ls -la "$app/bin" "$app/lib/app/resources"
|
|
du -sh "$app"
|
|
LD_LIBRARY_PATH="$app/lib/app/resources" ldd "$app/lib/app/resources/libapp-lib.so"
|
|
|
|
# a tarball keeps the app's file modes, which an artifact drops
|
|
- name: Pack app
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
|
run: tar -czf "$RUNNER_TEMP/desktop-app.tar.gz" -C apps/multiplatform/release/main/app simplex
|
|
|
|
- name: Upload app
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: desktop-app
|
|
path: ${{ runner.temp }}/desktop-app.tar.gz
|
|
compression-level: 0
|
|
retention-days: 14
|
|
if-no-files-found: error
|
|
|
|
- name: Run desktop tests
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
|
working-directory: apps/multiplatform
|
|
env:
|
|
SNAPSHOT_DIR: ${{ runner.temp }}/snapshots
|
|
run: ./gradlew --no-daemon --console=plain -Psimplex.assets.dir=../../assets -Pkotlin.daemon.jvmargs=-Xmx4g :common:desktopTest
|
|
|
|
- name: Report desktop tests
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
|
run: scripts/ci/desktop-linux/test-summary.py apps/multiplatform/common/build/test-results/desktopTest
|
|
|
|
- name: Compare snapshots
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
|
run: python3 scripts/ci/snapshots-compare.py apps/multiplatform/common/src/desktopTest/snapshots "$RUNNER_TEMP/snapshots" "$RUNNER_TEMP/snapshots-diff"
|
|
|
|
- name: Run smoke test
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' && steps.backend.outcome != 'failure' }}
|
|
env:
|
|
BACKEND: ${{ steps.backend.outcome }}
|
|
run: |
|
|
if [ "$BACKEND" = success ]; then
|
|
export NAMES_SERVER=$(cat "$RUNNER_TEMP/backend/names-server")
|
|
cases=backend
|
|
fi
|
|
scripts/ci/desktop-linux/smoke-test.sh apps/multiplatform/release/main/app/simplex "$RUNNER_TEMP/smoke-test" ${cases:-}
|
|
|
|
- name: Stop test backend
|
|
if: ${{ !cancelled() && steps.backend.outcome != 'skipped' }}
|
|
run: scripts/ci/desktop-linux/backend.sh stop "$RUNNER_TEMP/backend"
|
|
|
|
- name: Upload smoke test results
|
|
if: ${{ !cancelled() }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: desktop-smoke-test
|
|
path: ${{ runner.temp }}/smoke-test
|
|
retention-days: 3
|
|
if-no-files-found: warn
|
|
|
|
- name: Upload desktop test report
|
|
if: ${{ !cancelled() }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: desktop-test-report
|
|
path: |
|
|
apps/multiplatform/common/build/reports/tests/desktopTest
|
|
apps/multiplatform/common/build/test-results/desktopTest
|
|
retention-days: 3
|
|
if-no-files-found: warn
|
|
|
|
- name: Upload snapshots
|
|
if: ${{ !cancelled() }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: desktop-snapshots
|
|
path: |
|
|
${{ runner.temp }}/snapshots
|
|
${{ runner.temp }}/snapshots-diff
|
|
retention-days: 3
|
|
if-no-files-found: warn
|
|
|
|
- name: Upload backend logs
|
|
if: ${{ !cancelled() && steps.backend.outcome != 'skipped' }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: desktop-backend-logs
|
|
path: ${{ runner.temp }}/backend/*.log
|
|
retention-days: 3
|
|
if-no-files-found: warn
|
|
|
|
# Claude Code repeats the smoke test with the ui helper. Each run spends the Claude subscription's usage
|
|
# limits, so it runs only when asked for. The app-sim-claude environment's branch rule decides which branches
|
|
# may use the token.
|
|
claude:
|
|
name: Claude tests the desktop app
|
|
needs: [plan, app]
|
|
if: ${{ !cancelled() && needs.plan.outputs.run-claude == 'true' && needs.app.result == 'success' }}
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 120
|
|
environment:
|
|
name: app-sim-claude
|
|
deployment: false
|
|
concurrency:
|
|
group: desktop-linux-claude-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
env:
|
|
# the same in both app workflows
|
|
CLAUDE_CODE_VERSION: 2.1.300
|
|
CLAUDE_MODEL: claude-haiku-5-5
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install tools
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y xvfb xdotool openbox imagemagick tesseract-ocr sqlite3 fonts-dejavu-core
|
|
dpkg-query -W xvfb xdotool openbox imagemagick tesseract-ocr sqlite3 fonts-dejavu-core
|
|
|
|
- name: Download app
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: desktop-app
|
|
path: ${{ runner.temp }}
|
|
|
|
- name: Unpack app
|
|
run: |
|
|
mkdir -p "$RUNNER_TEMP/app"
|
|
tar -xzf "$RUNNER_TEMP/desktop-app.tar.gz" -C "$RUNNER_TEMP/app"
|
|
|
|
- name: Download backend
|
|
if: needs.plan.outputs.claude-backend == 'yes'
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: ${{ needs.plan.outputs.backend }}
|
|
path: ~/backend
|
|
run-id: ${{ needs.plan.outputs.backend-run || github.run_id }}
|
|
github-token: ${{ github.token }}
|
|
|
|
- name: Start test backend
|
|
id: backend
|
|
if: needs.plan.outputs.claude-backend == 'yes'
|
|
timeout-minutes: 30
|
|
run: scripts/ci/desktop-linux/backend.sh start ~/backend/${{ env.BACKEND_PKG }} "$RUNNER_TEMP/backend"
|
|
|
|
# ui goes on every shell's PATH, where Claude's Bash tool finds it whatever environment it builds
|
|
- name: Install Claude Code and the ui command
|
|
run: |
|
|
npm install --prefix "$RUNNER_TEMP/claude-code" "@anthropic-ai/claude-code@$CLAUDE_CODE_VERSION"
|
|
echo "$RUNNER_TEMP/claude-code/node_modules/.bin" >> "$GITHUB_PATH"
|
|
printf '#!/bin/sh\nexec %s/scripts/ci/desktop-linux/ui "$@"\n' "$PWD" | sudo tee /usr/local/bin/ui
|
|
sudo chmod +x /usr/local/bin/ui
|
|
|
|
- name: Start the app
|
|
run: scripts/ci/desktop-linux/smoke-test.sh "$RUNNER_TEMP/app/simplex" "$RUNNER_TEMP/claude-test/screens" start
|
|
|
|
- name: Add test images
|
|
run: |
|
|
mkdir -p "$RUNNER_TEMP/claude-test/images"
|
|
cp tests/fixtures/test.jpg "$RUNNER_TEMP/claude-test/images/test-card.jpg"
|
|
cp tests/fixtures/logo-large-rgba.png "$RUNNER_TEMP/claude-test/images/simplex-logo.png"
|
|
|
|
# Claude's Bash is limited to single ui commands by the guard hook in claude-test.sh. Claude Code's credential
|
|
# scrub stays off: on Linux it forces its whole Bash sandbox (bubblewrap, socat), which ui isn't set up for.
|
|
- name: Run Claude
|
|
id: claude
|
|
env:
|
|
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: 1
|
|
run: scripts/ci/desktop-linux/claude-test.sh "$RUNNER_TEMP/claude-test" "$RUNNER_TEMP/claude-transcript.jsonl"
|
|
|
|
- name: Report Claude usage
|
|
if: ${{ !cancelled() && steps.claude.outcome != 'skipped' }}
|
|
run: scripts/ci/desktop-linux/claude-usage.py "$RUNNER_TEMP/claude-transcript.jsonl" "$RUNNER_TEMP/claude-usage.json"
|
|
|
|
- name: Stop test backend
|
|
if: ${{ !cancelled() && steps.backend.outcome != 'skipped' }}
|
|
run: scripts/ci/desktop-linux/backend.sh stop "$RUNNER_TEMP/backend"
|
|
|
|
- name: Upload Claude test results
|
|
if: ${{ !cancelled() }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: desktop-claude-test
|
|
path: |
|
|
${{ runner.temp }}/claude-test
|
|
${{ runner.temp }}/claude-transcript.jsonl
|
|
${{ runner.temp }}/claude-transcript.jsonl.stderr
|
|
${{ runner.temp }}/claude-transcript.jsonl.guard.log
|
|
${{ runner.temp }}/claude-usage.json
|
|
retention-days: 7
|
|
if-no-files-found: warn
|
|
|
|
- name: Upload backend logs
|
|
if: ${{ !cancelled() && steps.backend.outcome != 'skipped' }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: desktop-claude-backend-logs
|
|
path: ${{ runner.temp }}/backend/*.log
|
|
retention-days: 3
|
|
if-no-files-found: warn
|
|
|
|
# the latest release's onboarding, to tell a branch's own failure from the runner's
|
|
release:
|
|
name: released app under Xvfb
|
|
needs: plan
|
|
if: needs.plan.outputs.run-release == 'true'
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
filter: tree:0
|
|
|
|
- name: Download released app
|
|
run: scripts/ci/desktop-linux/release-app.sh "$RUNNER_TEMP/release"
|
|
|
|
- name: Install UI tools
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y xvfb xdotool openbox imagemagick tesseract-ocr
|
|
dpkg-query -W xvfb xdotool openbox imagemagick tesseract-ocr
|
|
|
|
- name: Run smoke test
|
|
run: scripts/ci/desktop-linux/smoke-test.sh "$RUNNER_TEMP/release/app/opt/simplex" "$RUNNER_TEMP/smoke-test" onboarding
|
|
|
|
- name: Upload smoke test results
|
|
if: ${{ !cancelled() }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: desktop-release-smoke-test
|
|
path: ${{ runner.temp }}/smoke-test
|
|
retention-days: 3
|
|
if-no-files-found: warn
|