Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 32 additions & 8 deletions .github/workflows/Tests.yml
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
Copy link

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_request trigger is configured without a branches filter, while the push trigger restricts to master and develop branches. This creates an inconsistency where pull requests to any branch will trigger tests, but direct pushes only trigger on specific branches. Either the pull_request trigger should also specify branch restrictions, or the configuration intent needs clarification.

Fix in Cursor Fix in Web


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'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Hardcoded Foundry version appears to be placeholder text

The Foundry version is hardcoded to 1.2.0 with a comment that reads "Replace with the project's supported version." This appears to be placeholder template code that wasn't completed before committing. The comment explicitly indicates this value should be replaced with the actual version the project supports, not left as the example value.

Fix in Cursor Fix in Web


- 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