fix: serve prerendered data for trailing slash routes #3102
Workflow file for this run
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: Pull Request | |
| on: [pull_request] | |
| jobs: | |
| Format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Install Corepack | |
| run: npm install --global corepack | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v6.3.0 | |
| with: | |
| node-version-file: ".node-version" | |
| cache: yarn | |
| - name: Install dependencies | |
| run: yarn | |
| - name: Format check | |
| run: yarn ci:format | |
| Site_Checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Install Corepack | |
| run: npm install --global corepack | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v6.3.0 | |
| with: | |
| node-version-file: ".node-version" | |
| cache: yarn | |
| - name: Install dependencies | |
| run: yarn | |
| - name: Test examples and hrefs | |
| run: yarn test | |
| # Confirms that Wrangler can start the Docs Pages and Guide local dev servers. | |
| # This startup check intentionally excludes route-level application and Pages Function behavior. | |
| Wrangler: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v6.3.0 | |
| with: | |
| node-version-file: ".node-version" | |
| cache: yarn | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: yarn | |
| - name: Build ReScript | |
| run: yarn build:res | |
| - name: Build docs | |
| run: yarn build:vite | |
| - name: Validate Docs Wrangler dev server | |
| working-directory: apps/docs | |
| run: | | |
| yarn wrangler pages dev public --port 8788 > wrangler.log 2>&1 & | |
| server_pid=$! | |
| trap 'kill "$server_pid"' EXIT | |
| for _ in {1..15}; do | |
| if curl --max-time 2 --fail --silent http://127.0.0.1:8788/favicon.ico > /dev/null; then | |
| exit 0 | |
| fi | |
| sleep 1 | |
| done | |
| cat wrangler.log | |
| exit 1 | |
| - name: Build guide | |
| run: yarn build:guide | |
| - name: Validate Guide Wrangler dev server | |
| working-directory: apps/guide | |
| run: | | |
| yarn wrangler dev --port 8789 > wrangler.log 2>&1 & | |
| server_pid=$! | |
| trap 'kill "$server_pid"' EXIT | |
| for _ in {1..15}; do | |
| if curl --max-time 2 --fail --silent http://127.0.0.1:8789/ > /dev/null; then | |
| exit 0 | |
| fi | |
| sleep 1 | |
| done | |
| cat wrangler.log | |
| exit 1 | |
| Vitest: | |
| runs-on: ubuntu-latest | |
| container: | |
| # Keep this image tag aligned with package.json's playwright version. | |
| image: mcr.microsoft.com/playwright:v1.63.0-noble | |
| env: | |
| # The pinned Playwright image provides Chromium from this browser cache. | |
| PLAYWRIGHT_BROWSERS_PATH: /ms-playwright | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Install Corepack | |
| run: npm install --global corepack | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v6.3.0 | |
| with: | |
| node-version-file: ".node-version" | |
| cache: yarn | |
| - name: Install dependencies | |
| run: yarn | |
| - name: Build ReScript | |
| run: yarn build:res | |
| - name: Docs Vitest | |
| run: yarn workspace @rescript-lang/docs ci:test | |
| - name: Docs script tests (Node) | |
| run: yarn workspace @rescript-lang/docs ci:test:scripts | |
| - name: Guide Vitest | |
| run: yarn workspace @rescript-lang/guide ci:test | |
| Homepage_E2E: | |
| runs-on: ubuntu-latest | |
| env: | |
| VITE_ALGOLIA_APP_ID: test-app-id | |
| VITE_ALGOLIA_INDEX_NAME: test-index | |
| VITE_ALGOLIA_SEARCH_API_KEY: test-search-key | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Install Corepack | |
| run: npm install --global corepack | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v6.3.0 | |
| with: | |
| node-version-file: ".node-version" | |
| cache: yarn | |
| - name: Install dependencies | |
| run: yarn | |
| - name: Build docs | |
| run: yarn workspace @rescript-lang/docs build | |
| - name: Report homepage asset sizes | |
| run: yarn workspace @rescript-lang/docs ci:homepage-performance | |
| - name: Run homepage Cypress tests | |
| uses: cypress-io/github-action@v7 | |
| with: | |
| install: false | |
| working-directory: apps/docs | |
| browser: chrome | |
| config-file: cypress.homepage.config.mjs | |
| start: yarn serve:build | |
| wait-on: http://127.0.0.1:4173 | |
| - name: Upload Cypress artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: homepage-cypress-artifacts | |
| path: apps/docs/test-results/cypress | |
| Visual_Regression: | |
| runs-on: ubuntu-latest | |
| container: | |
| # Keep this image tag aligned with package.json's playwright version. | |
| image: mcr.microsoft.com/playwright:v1.63.0-noble | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Install Corepack | |
| run: npm install --global corepack | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v6.3.0 | |
| with: | |
| node-version-file: ".node-version" | |
| cache: yarn | |
| - name: Install dependencies | |
| run: yarn | |
| - name: Build ReScript | |
| run: yarn build:res | |
| - name: Visual regression tests | |
| run: yarn ci:test:visual | |
| - name: Upload visual regression artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: visual-regression-artifacts | |
| path: | | |
| apps/docs/.vitest-attachments |