-
Notifications
You must be signed in to change notification settings - Fork 137
Update Tests.yml #14
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
base: main
Are you sure you want to change the base?
Update Tests.yml #14
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,44 @@ | ||
| name: Tests | ||
|
|
||
| on: [push] | ||
| on: | ||
| push: | ||
| branches: | ||
| - master # Run on push to master branch | ||
| - develop # Optional: Include development branches | ||
| pull_request: # CRITICAL: Ensure tests run when a PR is opened/updated | ||
|
|
||
| jobs: | ||
| check: | ||
| name: Tests | ||
| name: Foundry Tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Checkout Repository and Submodules | ||
| # Use the latest stable version of the checkout action (v4) | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
| # Ensure recursive checkout for external dependencies (e.g., libraries like OpenZeppelin) | ||
| submodules: recursive | ||
|
|
||
| - name: Install Foundry | ||
| - name: Install Foundry Toolchain | ||
| uses: foundry-rs/foundry-toolchain@v1 | ||
| with: | ||
| version: nightly | ||
| # CRITICAL: Lock to a specific stable version (e.g., 1.2.0) | ||
| # instead of the unstable 'nightly'. Replace with the project's supported version. | ||
| version: '1.2.0' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Hardcoded Foundry version appears to be placeholder textThe Foundry version is hardcoded to |
||
|
|
||
| - name: Run tests | ||
| run: forge test -vvv | ||
| - name: Cache Dependencies | ||
| # Cache artifacts like compiled contracts, libraries, and external repos (.git) to speed up subsequent runs | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.foundry/cache | ||
| ./cache | ||
| ~/.cargo/bin/ | ||
| key: ${{ runner.os }}-${{ hashFiles('foundry.toml') }}-${{ hashFiles('lib/**/foundry.toml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}- | ||
|
|
||
| - name: Run Tests | ||
| # Run standard tests. Use '-vv' (two v's) for typical detailed output on failure. | ||
| # Use 'forge test' only, unless specific optimization is needed. | ||
| run: forge test -vv | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Pull request trigger missing branch filter
The
pull_requesttrigger is configured without abranchesfilter, while thepushtrigger restricts tomasteranddevelopbranches. This creates an inconsistency where pull requests to any branch will trigger tests, but direct pushes only trigger on specific branches. Either thepull_requesttrigger should also specify branch restrictions, or the configuration intent needs clarification.