Skip to content

Commit

Permalink
[ARC-204] set up CI for contracts (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyqs authored Sep 13, 2024
1 parent 954db63 commit 52bb092
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 57 deletions.
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## What's new in this PR?

In bullet point format, please describe what's new in this PR.

## Why?

What problem does this solve?
Why is this important?
What's the context?
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: test
name: Continuous Integration

on: workflow_dispatch
on:
push:
branches:
- main
pull_request:
branches:
- main

env:
FOUNDRY_PROFILE: ci
Expand All @@ -10,7 +16,7 @@ jobs:
strategy:
fail-fast: true

name: Foundry project
name: Build and Test Contracts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -28,7 +34,12 @@ jobs:
forge build --sizes
id: build

- name: Run Forge tests
- name: Run Forge format
run: |
forge test -vvv
id: test
forge fmt
id: format

# - name: Run Forge tests
# run: |
# forge test -vvv
# id: test
15 changes: 15 additions & 0 deletions foundry-template/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Compiler files
cache/
out/

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/*/18230/
/broadcast/**/dry-run/

# Docs
docs/

# Dotenv file
.env
9 changes: 9 additions & 0 deletions foundry-template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Foundry Template Setup

Copy this folder to start a new Foundry project, then run the following to initialize the submodules:

```bash
$ forge install foundry-rs/forge-std
$ forge install OpenZeppelin/openzeppelin-foundry-upgrades
$ forge install OpenZeppelin/openzeppelin-contracts-upgradeable
```
26 changes: 26 additions & 0 deletions foundry-template/foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[profile.default]
solc = "0.8.25"
evm_version = "cancun"
src = "src"
out = "out"
libs = ["lib"]
ffi = true
ast = true
build_info = true
extra_output = ["storageLayout"]

[fmt]
single_line_statement_blocks = "multi"
multiline_func_header = "params_first"
sort_imports = true
contract_new_lines = true
bracket_spacing = true
int_types = "long"
quote_style = "double"
number_underscore = "thousands"
wrap_comments = true

remappings = [
"@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
]
1 change: 1 addition & 0 deletions nest/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ out/
# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/*/18230/
/broadcast/**/dry-run/

# Docs
Expand Down
22 changes: 21 additions & 1 deletion nest/foundry.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
[profile.default]
solc = "0.8.25"
evm_version = "cancun"
src = "src"
out = "out"
libs = ["lib"]
ffi = true
ast = true
build_info = true
extra_output = ["storageLayout"]

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
[fmt]
single_line_statement_blocks = "multi"
multiline_func_header = "params_first"
sort_imports = true
contract_new_lines = true
bracket_spacing = true
int_types = "long"
quote_style = "double"
number_underscore = "thousands"
wrap_comments = true

remappings = [
"@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
]
12 changes: 0 additions & 12 deletions nest/script/Counter.s.sol

This file was deleted.

14 changes: 0 additions & 14 deletions nest/src/Counter.sol

This file was deleted.

24 changes: 0 additions & 24 deletions nest/test/Counter.t.sol

This file was deleted.

0 comments on commit 52bb092

Please sign in to comment.