askrobots / dbbasic-browser
Public
A desktop browser with x402 built in: when a page asks for payment, it pays in stablecoins and shows the content.
danq9
toolbar: Back and Forward are greyed out when there's nowhere to go
cc08c7a
1 week, 2 days ago
History
ci.yml · 3.3 KB · 73 lines
| 1 | name: CI |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [main] |
| 6 | pull_request: |
| 7 | |
| 8 | # Read-only: CI never needs to write to the repository. |
| 9 | permissions: |
| 10 | contents: read |
| 11 | |
| 12 | concurrency: |
| 13 | group: ci-${{ github.ref }} |
| 14 | cancel-in-progress: true |
| 15 | |
| 16 | jobs: |
| 17 | test: |
| 18 | runs-on: ubuntu-latest |
| 19 | timeout-minutes: 15 |
| 20 | steps: |
| 21 | # Actions are pinned to full commit SHAs (the version is in the comment), not floating tags: this project |
| 22 | # handles keys and wallets, so a moved tag must not be able to change what runs here. Dependabot bumps them. |
| 23 | - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 24 | - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 |
| 25 | with: |
| 26 | node-version: 22 |
| 27 | cache: npm |
| 28 | |
| 29 | # --ignore-scripts: no install script runs in CI, and none is needed. The Electron *binary* is only for |
| 30 | # running the app; typechecking, the unit tests and the bundle build need only its type definitions. |
| 31 | - run: npm ci --ignore-scripts |
| 32 | - run: npm run typecheck |
| 33 | - run: npm test |
| 34 | - run: npm run build -w @dbbasic/browser |
| 35 | |
| 36 | # Includes test/secrets.test.ts (above), which fails if an API key or private-key shape is committed. |
| 37 | # This checks the production dependency tree for known high-severity advisories. |
| 38 | - name: Audit production dependencies |
| 39 | run: npm audit --omit=dev --audit-level=high |
| 40 | |
| 41 | # The end-to-end suite: the real browser on Linux, driven through its automation API, under a virtual display. |
| 42 | # Hermetic like the local run: its own demo server on loopback, temp profiles and vaults, a scripted stand-in model. |
| 43 | # It never reaches a real AI provider or a real site (E2E_LIVE_NET and E2E_LIVE_AI stay off). |
| 44 | e2e-linux: |
| 45 | runs-on: ubuntu-24.04 |
| 46 | timeout-minutes: 30 |
| 47 | steps: |
| 48 | - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 49 | - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 |
| 50 | with: |
| 51 | node-version: 24 |
| 52 | cache: npm |
| 53 | |
| 54 | # Still no install scripts from the dependency tree. Only Electron's own download step runs, by name: it fetches |
| 55 | # the Electron binary from Electron's GitHub releases and checks it against the checksums shipped in the package. |
| 56 | - run: npm ci --ignore-scripts |
| 57 | - run: node node_modules/electron/install.js |
| 58 | - run: npm run build -w @dbbasic/browser |
| 59 | |
| 60 | # Ubuntu 24.04 restricts user namespaces, which Chromium's page sandbox needs. Allow them for the Electron binary |
| 61 | # only (an AppArmor profile), so the suite runs with the sandbox ON, as people will use it. Never --no-sandbox. |
| 62 | - name: Let the page sandbox start |
| 63 | run: sudo apps/browser/scripts/linux-sandbox.sh "$(node -p "require('electron')")" |
| 64 | |
| 65 | # No E2E_BACKGROUND here: nothing is on anyone's screen, and the background mode's hidden window is not drawn |
| 66 | # under a virtual display. No graphics card either, so the GPU is off. One suite at a time: browsers sharing one |
| 67 | # virtual display with no window manager sit on top of each other, and a page in a covered window reported itself |
| 68 | # hidden (slowed timers, stopped animations), which broke the timing checks. |
| 69 | - name: End-to-end suite |
| 70 | run: xvfb-run -a --server-args="-screen 0 1920x1080x24" npm run e2e -w @dbbasic/browser |
| 71 | env: |
| 72 | E2E_APP_ARGS: --disable-gpu |
| 73 | E2E_PARALLEL: "1" |