Computer use CLI for AI agents
Rust accessibilityaccessibility-apiai-agentsautomationclicomputer-usecomputer-use-agentcomputer-use-agentsdesktop-automationmacosmcprust
ci: upgrade actions to latest, pin SHAs, add ci profile and speed optimisations (#25)
Lahfirc0ab58978c89
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 85065677d..082e22bc1 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -6,23 +6,44 @@ on:pull_request:branches: [main, master]+# Cancel in-progress runs for the same ref so stale PR builds don't burn minutes.+concurrency:+ group: ci-${{ github.ref }}+ cancel-in-progress: true++# Deny all permissions at workflow level; each job declares only what it needs.+permissions: {}+env:CARGO_TERM_COLOR: alwaysRUST_BACKTRACE: 1jobs:+ fmt:+ name: Format+ runs-on: ubuntu-latest+ timeout-minutes: 10+ permissions:+ contents: read+ steps:+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ - run: rustup component add rustfmt+ - run: cargo fmt --all -- --check+test:name: Testruns-on: macos-latest-+ timeout-minutes: 30+ permissions:+ contents: readsteps:- - uses: actions/checkout@v4+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2- name: Install Rust toolchainrun: rustup show- name: Cache cargo registry- uses: actions/cache@v4+ uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5with:path: |~/.cargo/registry/index/@@ -32,13 +53,13 @@ jobs:restore-keys: ${{ runner.os }}-cargo-- name: Cache build artifacts- uses: actions/cache@v4+ uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5with:path: target/- key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/*.rs') }}+ key: ${{ runner.os }}-build-ci-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/*.rs') }}restore-keys: |- ${{ runner.os }}-build-${{ hashFiles('**/Cargo.toml') }}-- ${{ runner.os }}-build-+ ${{ runner.os }}-build-ci-${{ hashFiles('**/Cargo.toml') }}-+ ${{ runner.os }}-build-ci-- name: Check dependency isolationrun: |@@ -54,24 +75,17 @@ jobs:- name: Unit testsrun: cargo test --lib --workspace- - name: Build release binary- run: cargo build --release+ # Use the ci profile (no LTO, opt-level 1) — fast compile, still checks the binary builds.+ - name: Build binary (ci profile)+ run: cargo build --profile ci- name: Check binary sizerun: |- SIZE=$(stat -f%z target/release/agent-desktop)+ SIZE=$(stat -f%z target/ci/agent-desktop)LIMIT=$((15 * 1024 * 1024))- echo "Binary size: $(du -sh target/release/agent-desktop | cut -f1)"+ echo "Binary size: $(du -sh target/ci/agent-desktop | cut -f1)"if [ "$SIZE" -gt "$LIMIT" ]; thenecho "FAIL: binary exceeds 15MB limit (${SIZE} bytes)"exit 1fiecho "OK: binary within 15MB limit"-- fmt:- name: Format- runs-on: ubuntu-latest- steps:- - uses: actions/checkout@v4- - run: rustup component add rustfmt- - run: cargo fmt --all -- --checkdiff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 274149b6c..8736528e5 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -4,6 +4,13 @@ on:push:branches: [main]+# One release run per commit — never cancel, just queue.+concurrency:+ group: release-${{ github.sha }}++# Deny all permissions at workflow level; each job declares only what it needs.+permissions: {}+env:CARGO_TERM_COLOR: always@@ -11,6 +18,7 @@ jobs:release-please:name: Release Pleaseruns-on: ubuntu-latest+ timeout-minutes: 10permissions:contents: writepull-requests: write@@ -19,7 +27,7 @@ jobs:tag_name: ${{ steps.release.outputs.tag_name }}version: ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}steps:- - uses: googleapis/release-please-action@v4+ - uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1id: releasewith:config-file: release-please-config.json@@ -30,13 +38,18 @@ jobs:needs: release-pleaseif: needs.release-please.outputs.release_created == 'true'runs-on: macos-latest+ timeout-minutes: 30+ permissions:+ contents: read+ # Both arch targets build in parallel; one failure doesn't block the other.strategy:+ fail-fast: falsematrix:target:- aarch64-apple-darwin- x86_64-apple-darwinsteps:- - uses: actions/checkout@v4+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2with:ref: ${{ needs.release-please.outputs.tag_name }}@@ -46,7 +59,7 @@ jobs:rustup target add ${{ matrix.target }}- name: Cache cargo registry- uses: actions/cache@v4+ uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5with:path: |~/.cargo/registry/index/@@ -74,25 +87,26 @@ jobs:TARBALL="agent-desktop-v${VERSION}-${{ matrix.target }}.tar.gz"tar -czf "${TARBALL}" -C target/${{ matrix.target }}/release agent-desktopshasum -a 256 "${TARBALL}" > "${TARBALL}.sha256"- echo "TARBALL=${TARBALL}" >> "$GITHUB_ENV"- name: Upload artifact- uses: actions/upload-artifact@v4+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1with:name: binary-${{ matrix.target }}path: |agent-desktop-v*.tar.gzagent-desktop-v*.tar.gz.sha256+ retention-days: 1publish-github:name: Publish to GitHub Releaseneeds: [release-please, build]runs-on: ubuntu-latest+ timeout-minutes: 10permissions:contents: writesteps:- name: Download all artifacts- uses: actions/download-artifact@v4+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1with:pattern: binary-*merge-multiple: true@@ -116,17 +130,18 @@ jobs:name: Publish to npmneeds: [release-please, publish-github]runs-on: ubuntu-latest+ timeout-minutes: 15permissions:contents: readid-token: writesteps:- - uses: actions/checkout@v4+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2with:ref: ${{ needs.release-please.outputs.tag_name }}- - uses: actions/setup-node@v4+ - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0with:- node-version: 20+ node-version: '24'registry-url: https://registry.npmjs.org- name: Verify GitHub Release assets@@ -164,14 +179,17 @@ jobs:needs: [release-please]if: needs.release-please.outputs.release_created == 'true'runs-on: ubuntu-latest+ timeout-minutes: 10+ permissions:+ contents: readsteps:- - uses: actions/checkout@v4+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2with:ref: ${{ needs.release-please.outputs.tag_name }}- - uses: actions/setup-node@v4+ - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0with:- node-version: "22"+ node-version: '24'- name: Install ClawHub CLIrun: npm i -g clawhubdiff --git a/Cargo.toml b/Cargo.tomlindex 8f88a9abd..f27ebc91d 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -25,3 +25,13 @@ lto = truecodegen-units = 1strip = truepanic = "abort"++# Fast build for CI: skip LTO and size optimisations, keep debug info for+# better test failure messages. Inherits release settings not listed here.+[profile.ci]+inherits = "release"+opt-level = 1+lto = false+codegen-units = 16+strip = false+debug = 1