docs: add Context Visualizer and Guidance section to README #19
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Stub frontend embed dir | |
| run: | | |
| mkdir -p internal/web/dist | |
| echo '<!doctype html><html><head></head><body><div id="app"></div></body></html>' > internal/web/dist/index.html | |
| - uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 | |
| with: | |
| version: v2.10.1 | |
| test: | |
| name: Go Test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Setup MinGW (Windows) | |
| if: runner.os == 'Windows' | |
| uses: msys2/setup-msys2@cafece8e6baf9247cf9b1bf95097b0b983cc558d # v2 | |
| with: | |
| msystem: MINGW64 | |
| update: false | |
| install: mingw-w64-x86_64-gcc | |
| path-type: inherit | |
| - name: Stub frontend embed dir | |
| run: | | |
| mkdir -p internal/web/dist | |
| echo '<!doctype html><html><head></head><body><div id="app"></div></body></html>' > internal/web/dist/index.html | |
| - name: Run Go tests | |
| run: go test -tags fts5 ./... -v -count=1 | |
| env: | |
| CGO_ENABLED: "1" | |
| - name: Run Go tests (race detector) | |
| if: runner.os == 'Linux' | |
| run: go test -tags fts5 -race ./... -count=1 | |
| env: | |
| CGO_ENABLED: "1" | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Stub frontend embed dir | |
| run: | | |
| mkdir -p internal/web/dist | |
| echo '<!doctype html><html><head></head><body><div id="app"></div></body></html>' > internal/web/dist/index.html | |
| - name: Test with coverage | |
| run: go test -tags fts5 -race -coverprofile=coverage.out ./... | |
| env: | |
| CGO_ENABLED: "1" | |
| - name: Upload coverage | |
| id: codecov | |
| uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 | |
| with: | |
| files: coverage.out | |
| continue-on-error: true | |
| - name: Warn on coverage upload failure | |
| if: steps.codecov.outcome == 'failure' | |
| run: echo "::warning::Codecov upload failed" | |
| integration: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: agentsview_test | |
| POSTGRES_PASSWORD: agentsview_test_password | |
| POSTGRES_DB: agentsview_test | |
| ports: | |
| - 5433:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U agentsview_test -d agentsview_test" | |
| --health-interval 2s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Stub frontend embed dir | |
| run: | | |
| mkdir -p internal/web/dist | |
| echo '<!doctype html><html><head></head><body><div id="app"></div></body></html>' > internal/web/dist/index.html | |
| - name: Run PostgreSQL integration tests | |
| run: make test-postgres-ci | |
| env: | |
| CGO_ENABLED: "1" | |
| TEST_PG_URL: postgres://agentsview_test:agentsview_test_password@localhost:5433/agentsview_test?sslmode=disable | |
| - name: Build SSH test container | |
| run: docker build -t agentsview-sshd -f testdata/ssh/Dockerfile . | |
| - name: Start SSH test container | |
| run: | | |
| docker run -d --name sshd-test -p 2222:22 agentsview-sshd | |
| for i in $(seq 1 10); do nc -z localhost 2222 && break || sleep 1; done | |
| docker cp sshd-test:/tmp/test_ssh_key testdata/ssh/test_key | |
| chmod 600 testdata/ssh/test_key | |
| - name: Verify SSH connectivity | |
| run: | | |
| echo "=== Key file ===" | |
| ls -la testdata/ssh/test_key | |
| head -1 testdata/ssh/test_key | |
| echo "=== Container sshd_config ===" | |
| docker exec sshd-test cat /etc/ssh/sshd_config | |
| echo "=== Container authorized_keys ===" | |
| docker exec sshd-test cat /home/testuser/.ssh/authorized_keys | |
| echo "=== Test SSH connection ===" | |
| ssh -v -i testdata/ssh/test_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 2222 testuser@localhost echo "SSH works" 2>&1 || true | |
| - name: Run SSH integration tests | |
| run: make test-ssh-ci | |
| env: | |
| CGO_ENABLED: "1" | |
| TEST_SSH_HOST: localhost | |
| TEST_SSH_PORT: "2222" | |
| TEST_SSH_USER: testuser | |
| TEST_SSH_KEY: ${{ github.workspace }}/testdata/ssh/test_key | |
| e2e: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: "24" | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| working-directory: frontend | |
| - name: Build frontend | |
| run: npm run build | |
| working-directory: frontend | |
| - name: Embed frontend in Go source tree | |
| run: | | |
| rm -rf internal/web/dist | |
| cp -r frontend/dist internal/web/dist | |
| - name: Pre-build Go binaries | |
| run: | | |
| CGO_ENABLED=1 go build -tags fts5 \ | |
| -o /tmp/testfixture ./cmd/testfixture | |
| CGO_ENABLED=1 go build -tags fts5 \ | |
| -o /tmp/agentsview ./cmd/agentsview | |
| env: | |
| CGO_ENABLED: "1" | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium webkit | |
| working-directory: frontend | |
| - name: Run E2E tests | |
| run: npx playwright test --reporter=list | |
| working-directory: frontend | |
| env: | |
| E2E_PREBUILT_FIXTURE: /tmp/testfixture | |
| E2E_PREBUILT_SERVER: /tmp/agentsview |