Desktop shell: the window, the engine it acquires, and the stack it raises #11
Workflow file for this run
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
| name: Desktop | |
| # The shell is the one thing here that cannot be proved by running it on Linux: it is a macOS app, a | |
| # Windows app and a Linux app built from one tree, and the ways they differ are exactly the ways | |
| # this fails. So it builds on all three, on every change to it. | |
| on: | |
| pull_request: | |
| paths: ["desktop/**", ".github/workflows/desktop.yml"] | |
| push: | |
| branches: [main] | |
| paths: ["desktop/**", ".github/workflows/desktop.yml"] | |
| workflow_call: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: desktop-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| # Fast, and the only job that runs the assertions about what the shell writes into `.env` and | |
| # which socket it names. Those are the parts that carry what the platforms taught us, and they are | |
| # plain Rust: no window, no engine, no waiting. | |
| core: | |
| name: core | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| workspaces: desktop/src-tauri | |
| # Linux is the only target needing system libraries, and it needs them even to check. | |
| - run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - run: cargo fmt --check | |
| working-directory: desktop/src-tauri | |
| - run: cargo clippy --all-targets -- -D warnings | |
| working-directory: desktop/src-tauri | |
| - run: cargo test --lib | |
| working-directory: desktop/src-tauri | |
| # The three artifacts. Not `bundle`, which signs and notarizes: that is S7 and needs certificates | |
| # this workflow deliberately does not hold. This proves the tree builds into an app on each | |
| # platform, which is the thing that breaks when a dependency is not portable. | |
| app: | |
| name: app (${{ matrix.platform.name }}) | |
| runs-on: ${{ matrix.platform.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - name: macos | |
| runner: macos-latest | |
| - name: windows | |
| runner: windows-latest | |
| - name: linux | |
| runner: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.3.14 | |
| - uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| workspaces: desktop/src-tauri | |
| key: ${{ matrix.platform.name }} | |
| - if: matrix.platform.name == 'linux' | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - run: bun install --frozen-lockfile | |
| working-directory: desktop | |
| - run: bun run typecheck | |
| working-directory: desktop | |
| # `tauri build`, not `cargo build --release`. tauri-build emits `cargo:rustc-cfg=dev` | |
| # for anything the Tauri CLI did not build, so a plain cargo release binary still points | |
| # at the dev server and shows "Could not connect to localhost" when it is run. That | |
| # compiles, proves the Rust, and proves nothing about the thing people install. | |
| # | |
| # Bundling is included because the bundle is the product, and because the failures live | |
| # there: the Windows resource step needs an .ico, and macOS wants an .icns, neither of | |
| # which a compile would miss. | |
| - run: bun run tauri build | |
| working-directory: desktop |