ENH: Implement sticky RHS table of contents with scroll highlighting #1002
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: Build Example Project [using jupyter-book] | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Fetch lecture-python-programming.myst | |
| shell: bash -l {0} | |
| run: | | |
| git clone --branch quantecon-book-theme https://github.com/QuantEcon/lecture-python-programming.myst | |
| - name: Setup Anaconda | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| auto-update-conda: true | |
| auto-activate-base: true | |
| miniconda-version: 'latest' | |
| python-version: "3.13" | |
| environment-file: lecture-python-programming.myst/environment.yml | |
| activate-environment: lecture-python-programming | |
| - name: Install quantecon-book-theme | |
| shell: bash -l {0} | |
| run: | | |
| python -m pip install . | |
| - name: Display Conda Environment Versions | |
| shell: bash -l {0} | |
| run: conda list | |
| - name: Display Pip Versions | |
| shell: bash -l {0} | |
| run: pip list | |
| - name: Build HTML | |
| shell: bash -l {0} | |
| run: | | |
| cd lecture-python-programming.myst | |
| jb build lectures --path-output ./ | |
| # Visual Regression Testing | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - name: Install Playwright | |
| run: | | |
| npm ci | |
| npx playwright install --with-deps chromium | |
| - name: Run Visual Regression Tests | |
| id: visual-tests | |
| run: npm run test:visual | |
| continue-on-error: true | |
| env: | |
| SITE_PATH: lecture-python-programming.myst/_build/html | |
| - name: Upload Playwright Report | |
| uses: actions/upload-artifact@v5 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 | |
| - name: Upload Test Results (on failure) | |
| uses: actions/upload-artifact@v5 | |
| if: steps.visual-tests.outcome == 'failure' | |
| with: | |
| name: visual-test-diff | |
| path: test-results/ | |
| retention-days: 30 | |
| - name: Post Visual Test Results to PR | |
| uses: daun/playwright-report-summary@v3 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| report-file: playwright-report/results.json | |
| comment-title: '🎭 Visual Regression Test Results' | |
| - name: Fail if Visual Tests Failed | |
| if: steps.visual-tests.outcome == 'failure' | |
| run: exit 1 | |
| - name: Preview Deploy to Netlify | |
| uses: nwtgck/[email protected] | |
| with: | |
| publish-dir: 'lecture-python-programming.myst/_build/html/' | |
| production-branch: main | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| deploy-message: "Preview Deploy from GitHub Actions" | |
| env: | |
| NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
| NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |