update test #113
This file contains 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: Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
FOUNDRY_PROFILE: ci | |
jobs: | |
check: | |
strategy: | |
matrix: | |
solc_version: [0.8.24] | |
fail-fast: true | |
name: Foundry project | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Cache Foundry Build | |
uses: actions/cache@v3 | |
with: | |
path: ~/.foundry | |
key: foundry-cache-${{ runner.os }}-${{ hashFiles('foundry.toml') }} | |
restore-keys: | | |
foundry-cache-${{ runner.os }}- | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
cache: 'pip' | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 'lts/*' | |
cache: 'npm' | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Set Solidity Version | |
run: forge config set solc ${solc_version} | |
- name: Run Forge Build | |
run: | | |
forge --version | |
forge build --sizes | |
id: build | |
- name: Run Forge Tests | |
run: | | |
forge test -vvv | |
id: test | |
- name: Run Forge Coverage | |
run: | | |
forge coverage --report lcov | |
id: coverage | |
- name: Run Slither Analysis | |
continue-on-error: true # This ensures CI continues even if Slither finds issues | |
run: | | |
pip install slither-analyzer | |
slither . --config-file slither.config.json | |
id: slither | |
- name: Run Solhint | |
run: | | |
npm install -g solhint | |
solhint 'src/**/*.sol' | |
id: lint |