feat(budget): cap what an agent may spend in money, tokens, or working time #22
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
| # Scans the built docs site for WCAG 2 AA accessibility violations | |
| # with pa11y-ci, using the same "hugo server" flow contributors run | |
| # locally (see docs/Dockerfile). Lands as the last step of the | |
| # docs-a11y-audit remediation (docs-a11y-audit plan, PR 9): the fixes | |
| # in PRs 1-8 land first so this job starts from a green baseline. | |
| # | |
| # docs/.pa11yci.json lists each scanned page twice, once with | |
| # ?theme=light and once with ?theme=dark: the headless browser's | |
| # default color-scheme is otherwise indeterminate (observed as | |
| # "light" locally), so without the query param the gate would only | |
| # ever exercise one theme. js/app.js's initTheme() honors ?theme= | |
| # ahead of localStorage/prefers-color-scheme for exactly this reason. | |
| # | |
| # pa11y only treats HTML_CodeSniffer "error"-level results as | |
| # failures (warnings/notices are informational and excluded by | |
| # default), so this gates on real violations rather than every | |
| # possible nit — see docs/.pa11yci.json for the scanned URLs and | |
| # docs/STYLE.md for how to reproduce a failure locally. | |
| name: docs-a11y | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - ".github/workflows/docs-a11y.yml" | |
| - "docs/**" | |
| pull_request: | |
| paths: | |
| - ".github/workflows/docs-a11y.yml" | |
| - "docs/**" | |
| env: | |
| HUGO_VERSION: 0.163.0 | |
| jobs: | |
| pa11y: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| # pa11y-ci@3.1.0 bundles an old Puppeteer whose postinstall Chromium | |
| # download doesn't happen under `npx --yes` ("Could not find expected | |
| # browser (chrome) locally"). Installing a pinned Chrome and pointing | |
| # Puppeteer at it via PUPPETEER_EXECUTABLE_PATH (below) sidesteps that | |
| # download entirely, per pa11y-ci's own guidance for Ubuntu > 20.04. | |
| - name: Install Chrome | |
| id: setup-chrome | |
| uses: browser-actions/setup-chrome@2e1d749697dd1612b833dba4a722266286fbefcd # v2.1.2 | |
| with: | |
| chrome-version: stable | |
| - name: Install Hugo | |
| run: | | |
| curl -fsSL "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" \ | |
| | sudo tar -xz -C /usr/local/bin hugo | |
| hugo version | |
| - name: Start Hugo server | |
| working-directory: docs | |
| run: nohup hugo server --bind 127.0.0.1 --port 1313 > hugo-server.log 2>&1 & | |
| - name: Wait for server | |
| run: npx --yes wait-on@7.2.0 http://127.0.0.1:1313/docker-agent/ --timeout 60000 | |
| - name: Run pa11y-ci | |
| working-directory: docs | |
| env: | |
| PUPPETEER_EXECUTABLE_PATH: ${{ steps.setup-chrome.outputs.chrome-path }} | |
| run: npx --yes pa11y-ci@3.1.0 --config .pa11yci.json | |
| - name: Show Hugo server log on failure | |
| if: failure() | |
| working-directory: docs | |
| run: cat hugo-server.log || true |