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

test: fix existing unit tests and fix coverage report #5

Merged
merged 7 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ETHEREUM_RPC=your_rpc_url
99 changes: 50 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,70 @@
name: ci
on:
push:
branches:
- main
pull_request:
push:
branches:
- main
pull_request:

env:
ETHEREUM_RPC: ${{ secrets.ETHEREUM_RPC }}
ETHEREUM_RPC: ${{ secrets.ETHEREUM_RPC }}

jobs:
run-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
run-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: actions/setup-node@v3
- uses: actions/setup-node@v3

- name: Install node dependencies
run: npm install
- name: Install node dependencies
run: npm install

- name: Set up python
id: setup-python
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Set up python
id: setup-python
uses: actions/setup-python@v3
with:
python-version: 3.9

- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install Poetry
uses: snok/install-poetry@v1

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install python dependencies
run: poetry install --no-interaction
- name: Install python dependencies
run: poetry install --no-interaction

- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1
with:
version: nightly
- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1
with:
version: nightly

- name: Pull Submodules
run: forge update
- name: Pull Submodules
run: forge update

- name: Check formatting
run: npm run format:check
- name: Check formatting
run: npm run format:check

- name: Check linting
run: npm run lint:check
- name: Check linting
run: npm run lint:check

- name: Run tests
run: forge test --optimize --fork-url ${{ env.ETHEREUM_RPC }}
- name: Run tests
run: forge test --optimize --fork-url ${{ env.ETHEREUM_RPC }}

- name: Coverage
run: |
forge coverage --report lcov
id: coverage
- name: Coverage
run: |
sudo apt update && sudo apt install -y lcov
npm run coverage
id: coverage

- uses: codecov/codecov-action@v2
- uses: codecov/codecov-action@v2

# Too slow to run regularly
#- name: Run audit
# run: poetry run slither --solc-remaps @openzeppelin=lib/openzeppelin-contracts --solc-args optimize src/
# Too slow to run regularly
#- name: Run audit
# run: poetry run slither --solc-remaps @openzeppelin=lib/openzeppelin-contracts --solc-args optimize src/
1 change: 1 addition & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error",">=0.8.0"],
"no-inline-assembly": ["off", ">=0.8.0"]
}
}
Loading
Loading