Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXPERIMENTAL: Add tutorial testing workflows integrated with Sphinx docs #1571

Closed
wants to merge 13 commits into from

Conversation

robtaylor
Copy link

@robtaylor robtaylor commented Mar 17, 2025

Summary

Experimental draft PR exploring the use of Claude AI for tutorial testing and validation.

  • Added GitHub workflows to test the Amaranth tutorial code examples
  • Integrated with Sphinx documentation system (docs/tutorial.rst)
  • Removed standalone tutorial.md in favor of documentation integration
  • Created three complementary workflows:
    1. Basic code example testing (runs each example)
    2. Tutorial comprehension analysis (uses Claude to evaluate explanations)
    3. Step-by-step execution validation (uses Claude to extract and run steps)

Implementation Notes

  • The Claude-based workflows (comprehension and execution tests) are designed to be skipped when the ANTHROPIC_API_KEY secret is not configured
  • The basic code testing workflow does not require API keys and should run in any environment
  • All workflows include helpful warnings in their summaries when dependencies are missing

Test plan

  • Check that GitHub workflows trigger correctly
  • Verify the basic code examples run successfully
  • Ensure the tutorial is properly integrated with docs

Note: The Claude-based workflows require an ANTHROPIC_API_KEY secret to be set in the repository settings. Without this, they will be skipped but won't fail the PR checks.

🤖 Generated with Claude Code

robtaylor and others added 5 commits March 17, 2025 00:13
- Created a comprehensive tutorial for Amaranth HDL beginners
- Added CLAUDE.md with build commands and code style guidelines
- Tutorial progresses from simple to complex examples with explanations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replaced the existing tutorial placeholder with a complete tutorial
- Created code examples for each section of the tutorial
- Tutorial covers basic concepts to advanced topics like FSMs
- Includes troubleshooting and glossary sections
- Maintained references to existing community tutorials

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Validates all code examples referenced in tutorial.md
- Runs each example to verify it works correctly
- Checks generated outputs (Verilog files and simulation waveforms)
- Creates a test summary of which examples passed/failed
- Archives results as workflow artifacts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Created two new GitHub workflows:

1. Tutorial Comprehension Test:
   - Uses Claude to analyze the tutorial for consistency and comprehensibility
   - Checks code examples for correctness
   - Assesses the tutorial's quality for beginners
   - Identifies potential improvements

2. Tutorial Execution Test:
   - Uses Claude to extract executable steps from the tutorial
   - Automatically runs each code example
   - Records and analyzes execution results
   - Provides detailed feedback on example executability
   - Archives all generated outputs as workflow artifacts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Modified workflows to use docs/tutorial.rst instead of tutorial.md
- Added support for parsing RST format code blocks and includes
- Enhanced execution test to use actual code files from docs/_code/
- Removed standalone tutorial.md in favor of Sphinx integration
- Updated path triggers to focus on docs directory files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

codecov bot commented Mar 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.32%. Comparing base (54dd41d) to head (8cc20a8).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1571      +/-   ##
==========================================
- Coverage   91.32%   91.32%   -0.01%     
==========================================
  Files          44       44              
  Lines       11389    11388       -1     
  Branches     2219     2218       -1     
==========================================
- Hits        10401    10400       -1     
  Misses        827      827              
  Partials      161      161              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@whitequark
Copy link
Member

At the moment I'm not interested in any AI-related integrations.

@robtaylor
Copy link
Author

robtaylor commented Mar 17, 2025 via email

- Updated actions/checkout from v3 to v4
- Updated actions/setup-node from v3 to v4
- Updated actions/upload-artifact from v3 to v4

These changes should fix the 'Missing download info' errors in workflows.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@robtaylor robtaylor changed the title Add tutorial testing workflows integrated with Sphinx docs EXPERIMENTAL: Add tutorial testing workflows integrated with Sphinx docs Mar 17, 2025
robtaylor and others added 7 commits March 17, 2025 08:21
- Added checks for ANTHROPIC_API_KEY secret availability
- Skip Claude-based API calls when key is not available
- Added helpful warnings in workflow summaries when tests are skipped
- Made artifact uploads conditional on API key availability

This allows the workflows to pass when run in forks or environments
without the API key configured.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replaced manual PDM installation with official pdm-project/setup-pdm action
- Enabled caching for faster workflow execution
- Removed redundant Python setup steps

This should help fix the failing workflow checks by ensuring PDM is
properly installed and configured.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Added cache-dependency-path to use pyproject.toml instead of pdm.lock
- This allows PDM to work even in repositories without pdm.lock files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed inconsistent underline lengths in section headers
- Standardized section formatting across the document
- This resolves the documentation build warnings that were causing CI failures

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Added Python scripts to automatically fix RST formatting issues
- Fixed title underline lengths to match title text
- Added blank lines after bullet lists
- Fixed broken documentation link
- All warnings resolved in document and document-linkcheck

This resolves remaining doc build issues and should enable CI checks to pass.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Created docs/tools directory for documentation utilities
- Moved RST formatting scripts from root to docs/tools
- Added README.md with usage instructions for the tools

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@robtaylor
Copy link
Author

Moving to testing in robtaylor/amaranth for now to avoid noise.

@robtaylor robtaylor closed this Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants