Skip to content

Commit

Permalink
chore: update forge-std and fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
frontier159 committed Nov 20, 2023
1 parent 994aafd commit 8dc4731
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 64 deletions.
98 changes: 86 additions & 12 deletions .github/workflows/protocol-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ on:
paths:
- 'protocol/**'

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
e2eTest:
hardhatTests:
name: Hardhat Tests
runs-on: ubuntu-latest
steps:
Expand All @@ -29,33 +33,103 @@ jobs:
env:
TESTS_MAINNET_RPC_URL: ${{ secrets.TESTS_MAINNET_RPC_URL }}

fuzzTest:
foundryTests:
name: Foundry Tests
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
permissions:
# required for all workflows
security-events: write
# only required for workflows in private repositories
actions: read
contents: read
strategy:
matrix:
os:
- ubuntu-latest
node_version:
- 18

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions/setup-node@v3
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: ${{ matrix.node_version }}
cache: 'yarn'
cache-dependency-path: protocol/yarn.lock

- run: yarn install
- name: Install yarn project
run: yarn install
working-directory: protocol

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
# version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d
cache: true
#with:
# version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d

- run: forge --version
- name: Show the Foundry CI config
run: forge config
env:
FOUNDRY_PROFILE: ci

- name: Show the Foundry version
run: forge --version
working-directory: protocol

- name: Foundry tests
run: forge test --gas-report
working-directory: protocol
env:
FOUNDRY_PROFILE: ci
MAINNET_RPC_URL: ${{ secrets.TESTS_MAINNET_RPC_URL }}

slither:
name: Slither
runs-on: ${{ matrix.os }}
permissions:
# only required for workflows in private repositories
actions: read
contents: read
strategy:
matrix:
os:
- ubuntu-latest
node_version:
- 18

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: 'yarn'
cache-dependency-path: protocol/yarn.lock

- name: Run tests
run: FOUNDRY_PROFILE=ci forge test --gas-report
- name: Install yarn project
run: yarn install
working-directory: protocol

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
# version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d
cache: false

- name: install slither
run: cd protocol && pip install -r slither.requirements.txt

# Can't output to SARIF for private repos without paying for Advanced Security
- name: run slither
run: cd protocol && yarn slither-check
52 changes: 0 additions & 52 deletions .github/workflows/slither.yaml

This file was deleted.

0 comments on commit 8dc4731

Please sign in to comment.