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

[ARC-204] set up CI for contracts #2

Merged
merged 4 commits into from
Sep 13, 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
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
eyqs marked this conversation as resolved.
Show resolved Hide resolved
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.