Forgejo Actions: ci.yml (bun run ci incl. desktop Rust tests and clippy on push/PR to main) and desktop.yml on the VDS runner (cache, FORGEJO_PATH, Windows job only on a manual run with windows ticked)

This commit is contained in:
CRTkafa 2026-10-11 05:33:15 +08:00
parent 1637765c6f
commit d030cca19e
2 changed files with 76 additions and 9 deletions

54
.forgejo/workflows/ci.yml Normal file
View file

@ -0,0 +1,54 @@
# bun run ci on every push to main and every pull request into main: adapters, desktop version, tests, typecheck,
# desktop i18n / typecheck / build, desktop Rust tests and clippy, scrub. Runs on the VDS runner (docs/desktop-release.md).
# Publishes nothing: site/ is still published by Jenkins.
name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
env:
BUN_VERSION: '1.4.0'
CARGO_TERM_COLOR: never
CARGO_INCREMENTAL: '0'
jobs:
ci:
# runner label: ubuntu-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: System packages (Tauri on Linux)
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq --no-install-recommends libwebkit2gtk-4.1-dev libgtk-3-dev \
libayatana-appindicator3-dev librsvg2-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev libssl-dev libxdo-dev \
build-essential curl unzip pkg-config >/dev/null
- uses: actions/cache@v4
with:
path: |
~/.bun/install/cache
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
apps/desktop/src-tauri/target
key: ci-${{ runner.os }}-${{ hashFiles('bun.lock', 'apps/desktop/src-tauri/Cargo.lock') }}
restore-keys: ci-${{ runner.os }}-
- name: Bun and Rust
run: |
P="${FORGEJO_PATH:-$GITHUB_PATH}"
curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}" >/dev/null
echo "$HOME/.bun/bin" >> "$P"
command -v rustup || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --component clippy
echo "$HOME/.cargo/bin" >> "$P"
- name: Install
run: |
rustup component add clippy
bun --version && cargo --version
bun install --frozen-lockfile
- name: bun run ci
run: bun run ci

View file

@ -1,7 +1,9 @@
# storebound desktop: Linux (AppImage + deb) and Windows (NSIS, per user, unsigned) installers. # storebound desktop: Linux (AppImage + deb) and Windows (NSIS, per user, unsigned) installers.
# macOS is built, signed and notarized on the owner's Mac (tools/desktop-release.ts mac); the updater signing key # macOS is built, signed and notarized on the owner's Mac (tools/desktop-release.ts mac); the updater signing key
# never reaches a runner: the Mac signs these installers after downloading them (tools/desktop-release.ts add). # never reaches a runner: the Mac signs these installers after downloading them (tools/desktop-release.ts add).
# Runner setup (act_runner on the VDS for Linux in Docker, a Windows runner later): docs/desktop-release.md. # Runner setup (Forgejo runner on the VDS for Linux in Docker, a Windows runner later): docs/desktop-release.md.
# Publishes nothing: the installers are workflow artifacts only (14 days); `tools/desktop-release.ts add` on the Mac
# signs and stages them, and only `publish` puts anything on storebound.dev.
name: desktop name: desktop
on: on:
@ -22,7 +24,7 @@ env:
jobs: jobs:
linux: linux:
# act_runner label: ubuntu-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04 (glibc 2.35: the AppImage and the # runner label: ubuntu-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04 (glibc 2.35: the AppImage and the
# deb then run on Ubuntu 22.04 and newer, Debian 12) # deb then run on Ubuntu 22.04 and newer, Debian 12)
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
timeout-minutes: 90 timeout-minutes: 90
@ -36,16 +38,26 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: System packages - name: System packages
run: | run: |
sudo apt-get update sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev \ sudo apt-get install -y -qq --no-install-recommends libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev \
librsvg2-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev libssl-dev libxdo-dev patchelf file build-essential \ librsvg2-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev libssl-dev libxdo-dev patchelf file build-essential \
curl unzip squashfs-tools p7zip-full xz-utils curl unzip squashfs-tools p7zip-full xz-utils >/dev/null
- uses: actions/cache@v4
with:
path: |
~/.bun/install/cache
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: desktop-${{ runner.os }}-${{ hashFiles('bun.lock', 'apps/desktop/src-tauri/Cargo.lock') }}
restore-keys: desktop-${{ runner.os }}-
- name: Bun and Rust - name: Bun and Rust
run: | run: |
curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}" P="${FORGEJO_PATH:-$GITHUB_PATH}"
echo "$HOME/.bun/bin" >> "$GITHUB_PATH" curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}" >/dev/null
echo "$HOME/.bun/bin" >> "$P"
command -v rustup || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal command -v rustup || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" echo "$HOME/.cargo/bin" >> "$P"
- name: Install and check - name: Install and check
run: | run: |
bun install --frozen-lockfile bun install --frozen-lockfile
@ -74,7 +86,8 @@ jobs:
retention-days: 14 retention-days: 14
windows: windows:
if: ${{ inputs.windows }} # only on a manual run with "windows" ticked (a tag push never sets it), so without a Windows runner it is skipped
if: ${{ github.event_name == 'workflow_dispatch' && inputs.windows }}
# a Windows runner registered with the "windows" label (host mode): Rust (MSVC), Bun, 7-Zip # a Windows runner registered with the "windows" label (host mode): Rust (MSVC), Bun, 7-Zip
runs-on: windows runs-on: windows
timeout-minutes: 90 timeout-minutes: 90