Skip to content

Commit

Permalink
build: include test utils in package
Browse files Browse the repository at this point in the history
build: install prb test as npm package
build: install forge as npm package
build: remove gitmodules
ci: install node js dependencies in build and test job
chore: update remappings accordingly
  • Loading branch information
andreivladbrg committed Nov 16, 2023
1 parent 245e2bd commit 3043176
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 27 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ jobs:
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"
Expand Down Expand Up @@ -103,8 +101,6 @@ jobs:
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"
Expand All @@ -116,6 +112,20 @@ jobs:
key: "foundry-build-${{ github.sha }}"
path: "out-optimized"

- name: "Install Pnpm"
uses: "pnpm/action-setup@v2"
with:
version: "8"

- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
cache: "pnpm"
node-version: "lts/*"

- name: "Install the Node.js dependencies"
run: "pnpm install"

- name: "Run the tests against the optimized build"
run: "FOUNDRY_PROFILE=test-optimized forge test"

Expand All @@ -130,12 +140,24 @@ jobs:
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Install Pnpm"
uses: "pnpm/action-setup@v2"
with:
version: "8"

- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
cache: "pnpm"
node-version: "lts/*"

- name: "Install the Node.js dependencies"
run: "pnpm install"

- name: "Run the tests and generate the coverage report"
run: "forge coverage --report lcov"

Expand All @@ -155,8 +177,6 @@ jobs:
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Run Slither"
uses: "crytic/[email protected]"
Expand Down
8 changes: 0 additions & 8 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion lib/forge-std
Submodule forge-std deleted from 73d44e
1 change: 0 additions & 1 deletion lib/prb-test
Submodule prb-test deleted from cfc05f
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
"url": "https://github.com/PaulRBerg/prb-proxy/issues"
},
"devDependencies": {
"@forge/std": "github:foundry-rs/forge-std#e8a047e3f40f13fa37af6fe14e6e06283d9a060e",
"@prb/test": "0.6.4",
"prettier": "^2.8.8",
"solhint-community": "^3.5.2"
},
"files": [
"artifacts",
"src",
"test/utils",
"CHANGELOG.md"
],
"homepage": "https://github.com/PaulRBerg/prb-proxy#readme",
Expand All @@ -29,6 +32,10 @@
"solidity"
],
"license": "MIT",
"peerDependencies": {
"@forge/std": "github:foundry-rs/forge-std#e8a047e3f40f13fa37af6fe14e6e06283d9a060e",
"@prb/test": "0.6.4"
},
"publishConfig": {
"access": "public"
},
Expand Down
16 changes: 16 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@prb/test/=lib/prb-test/src/
forge-std/=lib/forge-std/src/
@forge-std/=node_modules/@forge/std/
@prb/test/=node_modules/@prb/test
2 changes: 1 addition & 1 deletion script/Base.s.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.19 <=0.9.0;

import { Script } from "forge-std/Script.sol";
import { Script } from "@forge-std/src/Script.sol";

abstract contract BaseScript is Script {
/// @dev Included to enable compilation of the script without a $MNEMONIC environment variable.
Expand Down
6 changes: 3 additions & 3 deletions test/Base.t.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.19 <=0.9.0;

import { eqString } from "@prb/test/Helpers.sol";
import { StdCheats } from "forge-std/StdCheats.sol";
import { StdUtils } from "forge-std/StdUtils.sol";
import { eqString } from "@prb/test/src/Helpers.sol";
import { StdCheats } from "@forge-std/src/StdCheats.sol";
import { StdUtils } from "@forge-std/src/StdUtils.sol";

import { IPRBProxy } from "../src/interfaces/IPRBProxy.sol";
import { IPRBProxyRegistry } from "../src/interfaces/IPRBProxyRegistry.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/proxy/execute/execute.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.19 <=0.9.0;

import { stdError } from "forge-std/StdError.sol";
import { stdError } from "@forge-std/src/StdError.sol";

import { IPRBProxy } from "src/interfaces/IPRBProxy.sol";

Expand Down
2 changes: 1 addition & 1 deletion test/proxy/run-plugin/runPlugin.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.18 <0.9.0;

import { stdError } from "forge-std/StdError.sol";
import { stdError } from "@forge-std/src/StdError.sol";

import { IPRBProxy } from "src/interfaces/IPRBProxy.sol";

Expand Down
2 changes: 1 addition & 1 deletion test/utils/Assertions.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.18;

import { PRBTest } from "@prb/test/PRBTest.sol";
import { PRBTest } from "@prb/test/src/PRBTest.sol";

import { IPRBProxyPlugin } from "../../src/interfaces/IPRBProxyPlugin.sol";

Expand Down

0 comments on commit 3043176

Please sign in to comment.