Skip to content

Commit

Permalink
test: fix existing unit tests and fix coverage report (#5)
Browse files Browse the repository at this point in the history
* test: fix existing unit tests and fix coverage report

* chore: add requested changes

* test: add cannot deploy tests, add remappings, fix linter

* test: add proxy tests, refactor existing tests to use proxy

* test: add admin unit tests (extract funds from contract)

* test: add receive unit test

* test: add requested changes
  • Loading branch information
cucupac authored Oct 24, 2023
1 parent f697cf9 commit 6526a75
Show file tree
Hide file tree
Showing 14 changed files with 702 additions and 106 deletions.
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

0 comments on commit 6526a75

Please sign in to comment.