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

build: switch to bun #20

Merged
merged 3 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
28 changes: 8 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,14 @@ jobs:
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

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

- name: "Install Yarn"
run: "npm install -g yarn"
- name: "Install Bun"
uses: "oven-sh/setup-bun@v1"

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

- name: "Lint the contracts"
run: "yarn lint"
- name: "Lint the code"
run: "bun run lint"

- name: "Add lint summary"
run: |
Expand All @@ -54,17 +48,11 @@ jobs:
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

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

- name: "Install Yarn"
run: "npm install -g yarn"
- name: "Install Bun"
uses: "oven-sh/setup-bun@v1"

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

- name: "Show the Foundry config"
run: "forge config"
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ out
.DS_Store
.pnp.*
lcov.info
package-lock.json
pnpm-lock.yaml
yarn.lock

# broadcasts
!broadcast
Expand Down
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ out-svg
*.sol
.DS_Store
.pnp.*
bun.lockb
lcov.info
package-lock.json
pnpm-lock.yaml
yarn.lock
yarn.lock
Binary file added bun.lockb
Binary file not shown.
7 changes: 3 additions & 4 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
auto_detect_solc = false
block_timestamp = 1_698_796_800 # November 1, 2023 at 00:00 GMT
bytecode_hash = "none"
#evm_version = "shanghai" # See https://www.evmdiff.com/features?name=PUSH0&kind=opcode
evm_version = "paris" # See https://www.evmdiff.com/features?name=PUSH0&kind=opcode
fuzz = { runs = 10_000 }
gas_reports = ["*"]
libs = ["lib"]
optimizer = true
optimizer_runs = 10_000
out = "out"
script = "script"
solc = "0.8.22"
solc = "0.8.23"
src = "src"
test = "test"

Expand All @@ -34,7 +33,7 @@
quote_style = "double"
tab_width = 4
wrap_comments = true

[rpc_endpoints]
arbitrum_one = "https://arbitrum-mainnet.infura.io/v3/${API_KEY_INFURA}"
avalanche = "https://avalanche-mainnet.infura.io/v3/${API_KEY_INFURA}"
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"@prb/math": "4.0.2"
},
"devDependencies": {
"@forge-std": "github:foundry-rs/forge-std#1.5.6",
"@prb/test": "^0.6.4",
"@prb/test": "0.6.4",
"forge-std": "github:foundry-rs/forge-std#v1.5.6",
"prettier": "3.0.0",
"solhint": "^4.0.0"
},
Expand All @@ -29,8 +29,8 @@
"scripts": {
"clean": "rm -rf cache out",
"build": "forge build",
"lint": "yarn lint:sol && yarn prettier:check",
"lint:sol": "forge fmt --check && yarn solhint {script,src,test}/**/*.sol",
"lint": "bun run lint:sol && bun run prettier:check",
"lint:sol": "forge fmt --check && bun solhint {script,src,test}/**/*.sol",
"prettier:check": "prettier --check **/*.{json,md,yml} --ignore-path=.prettierignore",
"prettier:write": "prettier --write **/*.{json,md,yml} --ignore-path=.prettierignore",
"test": "forge test",
Expand Down
2 changes: 1 addition & 1 deletion remappings.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@forge-std/=node_modules/@forge-std/
@forge-std/=node_modules/forge-std/
@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/
@prb/math/=node_modules/@prb/math/
@prb/test/=node_modules/@prb/test/
Loading