-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix existing unit tests and fix coverage report (#5)
* 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
Showing
14 changed files
with
702 additions
and
106 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ETHEREUM_RPC=your_rpc_url |
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
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/ |
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
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"] | ||
} | ||
} |
Oops, something went wrong.