|
4 | 4 | branches: [codex/ci-mts-typecheck-proof] |
5 | 5 | permissions: |
6 | 6 | contents: read |
| 7 | + actions: read |
7 | 8 | jobs: |
8 | 9 | qualify: |
| 10 | + if: false |
9 | 11 | runs-on: ubuntu-24.04 |
10 | 12 | timeout-minutes: 20 |
11 | 13 | steps: |
@@ -41,3 +43,180 @@ jobs: |
41 | 43 | scripts/tsconfig.mts.json |
42 | 44 | .github/CI.md |
43 | 45 | .github/workflows/checks.yml |
| 46 | +
|
| 47 | + docs-cold-search: |
| 48 | + name: docs cold search (${{ matrix.trial }}) |
| 49 | + runs-on: ${{ (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && 'blacksmith-8vcpu-ubuntu-2404' || 'linux-x64-8-core' }} |
| 50 | + timeout-minutes: 45 |
| 51 | + strategy: |
| 52 | + fail-fast: false |
| 53 | + matrix: |
| 54 | + include: |
| 55 | + - { group: webkit, trial: 1 } |
| 56 | + - { group: webkit, trial: 2 } |
| 57 | + - { group: webkit, trial: 3 } |
| 58 | + services: |
| 59 | + search-postgres: |
| 60 | + image: ${{ (matrix.group == 'http' || matrix.group == 'platform') && 'pgvector/pgvector:pg17' || '' }} |
| 61 | + env: |
| 62 | + POSTGRES_USER: docs_test |
| 63 | + POSTGRES_PASSWORD: docs_test |
| 64 | + POSTGRES_DB: docs_search_test |
| 65 | + ports: |
| 66 | + - 5432:5432 |
| 67 | + options: >- |
| 68 | + --health-cmd "pg_isready -U docs_test -d docs_search_test" |
| 69 | + --health-interval 5s |
| 70 | + --health-timeout 5s |
| 71 | + --health-retries 10 |
| 72 | + env: |
| 73 | + DATABASE_URL: postgresql://docs_test:docs_test@127.0.0.1:1/docs_test |
| 74 | + DOCS_E2E_BASE_URL: http://127.0.0.1:3001 |
| 75 | + DOCS_NEGOTIATION_REPORT_PATH: ${{ github.workspace }}/apps/docs/test-results/docs-negotiation.json |
| 76 | + DOCS_SEARCH_E2E_DATABASE_URL: postgresql://docs_test:docs_test@127.0.0.1:5432/docs_search_test |
| 77 | + DOCS_SEARCH_E2E_REPORT_PATH: ${{ github.workspace }}/apps/docs/test-results/search-postgres/report.json |
| 78 | + DOCS_INTERFACES_REPORT_PATH: ${{ github.workspace }}/apps/docs/test-results/docs-interfaces.json |
| 79 | + DOCS_CORPUS_REPORT_PATH: ${{ github.workspace }}/apps/docs/test-results/docs-corpus.json |
| 80 | + DOCS_NAVIGATION_FILTER: Search keyboard navigation |
| 81 | + DOCS_NAVIGATION_BROWSER: ${{ matrix.group }} |
| 82 | + DOCS_NAVIGATION_REPORT_PATH: ${{ github.workspace }}/apps/docs/test-results/navigation-${{ matrix.group }}/docs.json |
| 83 | + DOCS_SAMPLES_REPORT_PATH: ${{ github.workspace }}/apps/docs/test-results/samples/report.json |
| 84 | + DOCS_SAMPLES_SYNTAX_LANGUAGES: javascript,python,bash,go,java,csharp |
| 85 | + DOCS_SAMPLES_HTTP_BASE_URL: http://127.0.0.1:3001 |
| 86 | + DOCS_PROVIDER_E2E_DATABASE_URL: postgresql://docs_test:docs_test@127.0.0.1:5432/docs_search_test |
| 87 | + DOCS_PROVIDER_E2E_BASE_URL: http://127.0.0.1:3001 |
| 88 | + DOCS_PROVIDER_E2E_REPORT_PATH: ${{ github.workspace }}/apps/docs/test-results/platform-consumer/report.json |
| 89 | + steps: |
| 90 | + - name: Checkout code |
| 91 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 |
| 92 | + with: |
| 93 | + fetch-depth: 8 |
| 94 | + - name: Setup workspace |
| 95 | + uses: ./.github/actions/setup |
| 96 | + with: |
| 97 | + provider: ${{ vars.CI_PROVIDER }} |
| 98 | + - name: Verify and download the exact failed-release build |
| 99 | + env: |
| 100 | + GH_TOKEN: ${{ github.token }} |
| 101 | + run: | |
| 102 | + gh api repos/simstudioai/sim/actions/runs/44143013004 > "$RUNNER_TEMP/producer.json" |
| 103 | + jq -e '.head_sha == "769e5ba534a7b5ce6a03156db29cc67b383ec56c" and .event == "pull_request"' "$RUNNER_TEMP/producer.json" |
| 104 | + gh api 'repos/simstudioai/sim/actions/runs/44143013004/jobs?per_page=100' > "$RUNNER_TEMP/producer-jobs.json" |
| 105 | + jq -e '[.jobs[] | select(.name == "docs build" and .conclusion == "success")] | length == 1' "$RUNNER_TEMP/producer-jobs.json" |
| 106 | + git diff --exit-code 769e5ba534a7b5ce6a03156db29cc67b383ec56c -- apps/docs ':(exclude)apps/docs/scripts/test-navigation-e2e.ts' |
| 107 | + gh run download 44143013004 --repo simstudioai/sim --name docs-build |
| 108 | + - name: Extract production docs |
| 109 | + run: tar -I zstd -xf docs-build.tar.zst -C apps/docs |
| 110 | + - name: Set up Java for copied request examples |
| 111 | + if: matrix.group == 'http' |
| 112 | + uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0 |
| 113 | + with: |
| 114 | + distribution: temurin |
| 115 | + java-version: '17' |
| 116 | + - name: Set up .NET for copied request examples |
| 117 | + if: matrix.group == 'http' |
| 118 | + uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 |
| 119 | + with: |
| 120 | + dotnet-version: '8.0.x' |
| 121 | + - name: Set up Go for copied request examples |
| 122 | + if: matrix.group == 'http' |
| 123 | + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 |
| 124 | + with: |
| 125 | + go-version: '1.25.x' |
| 126 | + cache: false |
| 127 | + - name: Install the selected navigation browser |
| 128 | + if: matrix.group == 'chromium' || (matrix.group == 'webkit' && vars.CI_PROVIDER != '' && vars.CI_PROVIDER != 'blacksmith') |
| 129 | + env: |
| 130 | + BROWSER: ${{ matrix.group }} |
| 131 | + run: bash .github/scripts/install-playwright.sh --only-shell "$BROWSER" |
| 132 | + - name: Verify production documentation |
| 133 | + id: acceptance |
| 134 | + env: |
| 135 | + DOCS_ACCEPTANCE_GROUP: ${{ matrix.group }} |
| 136 | + run: | |
| 137 | + unset PLAYWRIGHT_WEBKIT_WS_ENDPOINT |
| 138 | + webkit_state='' |
| 139 | + mkdir -p apps/docs/test-results |
| 140 | + FEEDBACK_TLS_DIR=$(mktemp -d) |
| 141 | + export DOCS_FEEDBACK_TEST_CERT="$FEEDBACK_TLS_DIR/cert.pem" |
| 142 | + export DOCS_FEEDBACK_TEST_KEY="$FEEDBACK_TLS_DIR/key.pem" |
| 143 | + openssl req -x509 -newkey rsa:2048 -nodes -days 1 -subj '/CN=127.0.0.1' -addext 'subjectAltName=IP:127.0.0.1' -keyout "$DOCS_FEEDBACK_TEST_KEY" -out "$DOCS_FEEDBACK_TEST_CERT" 2>/dev/null |
| 144 | + export NODE_EXTRA_CA_CERTS="$DOCS_FEEDBACK_TEST_CERT" |
| 145 | + export DOCS_FEEDBACK_WEBHOOK_URL=https://127.0.0.1:3443/feedback |
| 146 | + DOCS_FEEDBACK_WEBHOOK_TOKEN=$(openssl rand -hex 32) |
| 147 | + export DOCS_FEEDBACK_WEBHOOK_TOKEN |
| 148 | + APP_TAG="docs-$DOCS_ACCEPTANCE_GROUP-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT-$$" |
| 149 | + E2E_APP="$APP_TAG" setsid --wait bun run --cwd apps/docs start --port 3001 >apps/docs/test-results/docs-server.log 2>&1 & |
| 150 | + DOCS_SERVER_PID=$! |
| 151 | + finish() { |
| 152 | + local status=$1 |
| 153 | + trap - EXIT INT TERM |
| 154 | + if bash .github/scripts/stop-session.sh "$DOCS_SERVER_PID" "$APP_TAG"; then |
| 155 | + wait "$DOCS_SERVER_PID" 2>/dev/null || true |
| 156 | + else |
| 157 | + if [ "$status" -eq 0 ]; then status=1; fi |
| 158 | + fi |
| 159 | + if [ -n "$webkit_state" ] && ! bash .github/scripts/playwright-server.sh stop "$webkit_state"; then |
| 160 | + echo '::error::Owned WebKit server cleanup failed.' >&2 |
| 161 | + if [ "$status" -eq 0 ]; then status=1; fi |
| 162 | + fi |
| 163 | + rm -rf "$FEEDBACK_TLS_DIR" |
| 164 | + exit "$status" |
| 165 | + } |
| 166 | + trap 'finish "$?"' EXIT |
| 167 | + trap 'exit 130' INT |
| 168 | + trap 'exit 143' TERM |
| 169 | + if [ "${{ matrix.group == 'webkit' && (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') }}" = true ]; then |
| 170 | + webkit_state="$RUNNER_TEMP/playwright-webkit-server" |
| 171 | + PLAYWRIGHT_WEBKIT_WS_ENDPOINT=$(bash .github/scripts/playwright-server.sh start "$webkit_state") |
| 172 | + export PLAYWRIGHT_WEBKIT_WS_ENDPOINT |
| 173 | + fi |
| 174 | + for attempt in $(seq 1 60); do |
| 175 | + if ! kill -0 "$DOCS_SERVER_PID" 2>/dev/null; then |
| 176 | + echo '::error::Documentation server exited before becoming ready.' |
| 177 | + exit 1 |
| 178 | + fi |
| 179 | + if curl -fsS --max-time 2 "$DOCS_E2E_BASE_URL/introduction" -o /dev/null; then |
| 180 | + break |
| 181 | + fi |
| 182 | + if [ "$attempt" -eq 60 ]; then |
| 183 | + echo '::error::Documentation server did not become ready.' |
| 184 | + exit 1 |
| 185 | + fi |
| 186 | + sleep 1 |
| 187 | + done |
| 188 | + STATUS=0 |
| 189 | + case "$DOCS_ACCEPTANCE_GROUP" in |
| 190 | + http) |
| 191 | + bun run --cwd apps/docs test:search:postgres:e2e || STATUS=1 |
| 192 | + bun run --cwd apps/docs test:negotiation:e2e || STATUS=1 |
| 193 | + bun run --cwd apps/docs scripts/test-docs-interfaces-e2e.ts || STATUS=1 |
| 194 | + bun run --cwd apps/docs scripts/verify-api-samples.ts || STATUS=1 |
| 195 | + bun --cwd apps/sim --no-env-file scripts/test-docs-search-provider-e2e.ts || STATUS=1 |
| 196 | + ;; |
| 197 | + platform) bun --cwd apps/sim --no-env-file scripts/test-docs-search-provider-e2e.ts || STATUS=1 ;; |
| 198 | + corpus) bun run --cwd apps/docs test:corpus:e2e || STATUS=1 ;; |
| 199 | + chromium|webkit) bun run --cwd apps/docs test:navigation:e2e || STATUS=1 ;; |
| 200 | + *) echo "::error::Unknown documentation acceptance group: $DOCS_ACCEPTANCE_GROUP"; STATUS=1 ;; |
| 201 | + esac |
| 202 | + finish "$STATUS" |
| 203 | + - name: Stop the owned WebKit server |
| 204 | + if: always() && matrix.group == 'webkit' && (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && steps.acceptance.outcome != 'skipped' |
| 205 | + run: bash .github/scripts/playwright-server.sh stop "$RUNNER_TEMP/playwright-webkit-server" |
| 206 | + - name: Upload WebKit server failure logs |
| 207 | + if: failure() && matrix.group == 'webkit' && (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') |
| 208 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 209 | + with: |
| 210 | + name: webkit-server-docs-${{ matrix.trial }} |
| 211 | + path: ${{ runner.temp }}/playwright-webkit-server/ |
| 212 | + if-no-files-found: ignore |
| 213 | + retention-days: 14 |
| 214 | + - name: Upload acceptance regression reports |
| 215 | + if: always() |
| 216 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 217 | + with: |
| 218 | + name: docs-cold-search-${{ matrix.trial }} |
| 219 | + path: apps/docs/test-results/ |
| 220 | + if-no-files-found: warn |
| 221 | + retention-days: 14 |
| 222 | + |
0 commit comments