feat: add admin shell to cloud portal (RootRail, sidebar, leaderboard) #1
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
| # CI for a project that ships two binaries and asks you to install nothing | |
| # beside them — plus the cloud half: the portal and the ingest function. | |
| # | |
| # The Rust jobs are the same shape: format, lint, test against the real | |
| # machine, then build and run the thing. `cargo tree --depth 1` is printed in | |
| # each so a new dependency has to be noticed in review rather than discovered | |
| # later — the closest equivalent to the "no third-party imports" check this | |
| # repo had while it was Python, and the same intent: the dependency list is a | |
| # test. | |
| # | |
| # The `cloud` job exists for one reason above the others: the pairing code is | |
| # derived in three languages, and the same vectors are asserted in | |
| # server/tests/pairing.rs, amplify/functions/ingest/protocol.test.mjs and | |
| # site/tests/portal.spec.js. Any two of those can drift silently unless all | |
| # three run on every push. | |
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| agent: | |
| name: agent · ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: agent | |
| - name: Direct dependencies, for the record | |
| run: cargo tree --depth 1 --manifest-path agent/Cargo.toml | |
| - name: Formatting and lints | |
| run: | | |
| cargo fmt --manifest-path agent/Cargo.toml --check | |
| cargo clippy --manifest-path agent/Cargo.toml --all-targets -- -D warnings | |
| - name: Tests | |
| # A runner has no ~/.claude, so the checks that need one skip and say | |
| # so. --nocapture is what makes those skips visible in the log rather | |
| # than a green tick over eleven tests that mostly did nothing. | |
| run: cargo test --manifest-path agent/Cargo.toml -- --nocapture | |
| - name: It builds, and it is small | |
| run: | | |
| cargo build --release --manifest-path agent/Cargo.toml | |
| ls -l agent/target/release/tokenhud-agent | |
| ./agent/target/release/tokenhud-agent --dry-run > /dev/null | |
| server: | |
| name: server · ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: server | |
| - name: Direct dependencies, for the record | |
| run: cargo tree --depth 1 --manifest-path server/Cargo.toml | |
| - name: Formatting and lints | |
| run: | | |
| cargo fmt --manifest-path server/Cargo.toml --check | |
| cargo clippy --manifest-path server/Cargo.toml --all-targets -- -D warnings | |
| - name: Tests | |
| run: cargo test --manifest-path server/Cargo.toml | |
| - name: It builds, and it is small | |
| run: | | |
| cargo build --release --manifest-path server/Cargo.toml | |
| ls -l server/target/release/tokenhud-server | |
| cloud: | |
| name: portal · ingest function | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: | | |
| package-lock.json | |
| site/package-lock.json | |
| - name: Install | |
| run: | | |
| npm ci | |
| npm ci --prefix site | |
| - name: The ingest function typechecks | |
| run: npm run typecheck | |
| - name: The wire protocol still agrees with the server | |
| # protocol.test.mjs asserts the pairing vectors the Rust server | |
| # generated; server/tests/pairing.rs asserts the same table. | |
| run: npm test | |
| - name: Portal lints and builds | |
| run: | | |
| npm run lint --prefix site | |
| npm run build --prefix site | |
| - name: Portal behaves | |
| # The signed-out portal, and the browser's half of the pairing | |
| # contract. Tests needing a deployed backend skip and say so. | |
| working-directory: site | |
| run: | | |
| npx playwright install --with-deps chromium | |
| npm test |