refactor: modularize architecture and harden runtime behavior #6
This file contains hidden or 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
| # SPDX-FileCopyrightText: 2026 ChouChiu | |
| # SPDX-License-Identifier: AGPL-3.0-only | |
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: "1" | |
| jobs: | |
| quality: | |
| name: Frontend and Rust quality | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| container: | |
| image: archlinux:latest | |
| steps: | |
| - name: Install build dependencies | |
| run: >- | |
| pacman -Syu --noconfirm --needed | |
| base-devel | |
| git | |
| gtk4 | |
| gtk4-layer-shell | |
| webkitgtk-6.0 | |
| openssl | |
| rust | |
| unzip | |
| - name: Check out source | |
| uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Trust checked-out workspace | |
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 1.3.14 | |
| - name: Restore Bun cache | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: bun-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('bun.lock') }} | |
| restore-keys: | | |
| bun-${{ runner.os }}-${{ runner.arch }}- | |
| - name: Restore Cargo cache | |
| uses: actions/cache@v6 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: cargo-${{ runner.os }}-${{ runner.arch }}-arch-${{ hashFiles('rust-toolchain.toml', 'Cargo.lock') }}-${{ github.sha }} | |
| restore-keys: | | |
| cargo-${{ runner.os }}-${{ runner.arch }}-arch-${{ hashFiles('rust-toolchain.toml', 'Cargo.lock') }}- | |
| cargo-${{ runner.os }}-${{ runner.arch }}-arch- | |
| - name: Install frontend dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Check frontend | |
| run: | | |
| bun run check | |
| bun run typecheck | |
| bun test | |
| - name: Verify dependency licenses | |
| run: | | |
| cargo install --locked --features cli --version 0.9.1 cargo-about | |
| cargo about generate --locked --all-features data/licenses/about.hbs \ | |
| --output-file data/licenses/dependencies.json | |
| git diff --exit-code -- data/licenses/dependencies.json | |
| - name: Check Rust formatting | |
| run: cargo fmt --all -- --check | |
| - name: Lint Rust | |
| run: cargo clippy --locked --all-targets --all-features -- -D warnings | |
| - name: Test workspace | |
| run: cargo test --locked --all-targets --all-features | |
| - name: Build documentation | |
| run: cargo docs | |
| - name: Build release binary | |
| run: cargo build --locked --release |