-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add CI, update repo layout and configuration
- Loading branch information
Showing
68 changed files
with
40,700 additions
and
11,053 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
name: Lints | ||
|
||
on: [push] | ||
|
||
jobs: | ||
lints: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
|
||
- name: Install Foundry | ||
uses: onbjerg/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
- name: Update Modules | ||
run: npm run update | ||
- name: Run linter | ||
run: npm run lint |
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,65 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
foundry: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Foundry project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Run Forge build | ||
run: | | ||
forge --version | ||
forge build --sizes | ||
id: build | ||
|
||
- name: Run Forge tests | ||
run: | | ||
forge test -vvv | ||
id: forge-test | ||
|
||
hardhat: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Hardhat project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup Node 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16.x" | ||
cache: "npm" | ||
|
||
- name: Install Node dependencies | ||
run: | | ||
npm ci | ||
- name: Run Hardhat tests | ||
run: | | ||
npx hardhat compile | ||
npx hardhat test | ||
id: hardhat-test |
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,42 +1,25 @@ | ||
# directories | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/releases | ||
!.yarn/plugins | ||
!.yarn/sdks | ||
!.yarn/versions | ||
**/artifacts | ||
**/build | ||
**/cache | ||
**/coverage | ||
**/.coverage_artifacts | ||
**/.coverage_cache | ||
**/.coverage_contracts | ||
**/dist | ||
**/node_modules | ||
**/out | ||
# Foundry | ||
cache/ | ||
out/ | ||
|
||
# files | ||
*.env | ||
*.log | ||
.pnp.* | ||
coverage.json | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
gas-report | ||
.DS_Store | ||
# Environment variables! | ||
.env | ||
.env.prod | ||
|
||
# JS | ||
node_modules/ | ||
|
||
# types | ||
src/types/* | ||
!src/types/common.ts | ||
!src/types/Greeter.ts | ||
# Hardhat files | ||
cache_hardhat/ | ||
artifacts/ | ||
|
||
# factories | ||
!src/types/factories | ||
src/types/factories/* | ||
!src/types/factories/Greeter__factory.ts | ||
# Hardhat plugin files | ||
typechain-types/ | ||
|
||
package-lock.json | ||
secrets.json | ||
contracts-exposed | ||
# Flattened files | ||
flattened.txt | ||
|
||
# Package Manager files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file was deleted.
Oops, something went wrong.
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,21 +1,8 @@ | ||
# directories | ||
.yarn/ | ||
**/.coverage_artifacts | ||
**/.coverage_cache | ||
**/.coverage_contracts | ||
**/artifacts | ||
**/build | ||
**/cache | ||
**/coverage | ||
**/dist | ||
**/node_modules | ||
**/types | ||
|
||
# files | ||
*.env | ||
*.log | ||
.pnp.* | ||
coverage.json | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
build | ||
coverage | ||
out | ||
lib | ||
node_modules | ||
artifacts | ||
typechain-types | ||
.next |
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
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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,3 +1,11 @@ | ||
{ | ||
"solidity.compileUsingRemoteVersion": "v0.8.11+commit.fc410830" | ||
} | ||
"solidity.packageDefaultDependenciesContractsDirectory": "src", | ||
"solidity.packageDefaultDependenciesDirectory": "lib", | ||
"solidity.compileUsingRemoteVersion": "v0.8.11", | ||
"search.exclude": { "lib": true }, | ||
"editor.formatOnSave": true, | ||
"solidity.formatter": "prettier", | ||
"[solidity]": { | ||
"editor.defaultFormatter": "JuanBlanco.solidity" | ||
} | ||
} |
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,33 +1,45 @@ | ||
# cellar-contracts | ||
# Sommelier Cellar Contracts • [](https://github.com/PeggyJV/cellar-contracts/actions/workflows/tests.yml) [](https://github.com/PeggyJV/cellar-contracts/actions/workflows/lints.yml)  | ||
|
||
Cellar contracts for Sommelier Network | ||
|
||
## Getting Started | ||
### Getting Started | ||
|
||
Run: | ||
- Use Foundry: | ||
|
||
```bash | ||
yarn install && yarn compile | ||
forge install | ||
forge test | ||
``` | ||
|
||
## Testing | ||
|
||
Run tests: | ||
- Use Hardhat: | ||
|
||
```bash | ||
yarn test | ||
npm install | ||
npx hardhat test | ||
``` | ||
|
||
Run to see test coverage (only for Hardhat test currently): | ||
### Development | ||
|
||
- Run tests with either Hardhat or Foundry: | ||
|
||
```bash | ||
yarn coverage | ||
forge test | ||
# or | ||
npx hardhat test | ||
``` | ||
|
||
## Clearing Caches | ||
- Use Hardhat's task framework: | ||
|
||
Run: | ||
```bash | ||
npx hardhat example | ||
``` | ||
|
||
- Install libraries with Foundry which work with Hardhat: | ||
|
||
```bash | ||
yarn clean | ||
forge install rari-capital/solmate # Already in this repo, just an example | ||
``` | ||
|
||
### Notes | ||
|
||
Whenever you install new libraries using Foundry, make sure to update your `remappings.txt` file by running `forge remappings > remappings.txt`. This is required because we use `hardhat-preprocessor` and the `remappings.txt` file to allow Hardhat to resolve libraries you install with Foundry. |
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,7 +1,14 @@ | ||
[default] | ||
src = 'contracts' | ||
libs = ['lib'] | ||
out = 'out' | ||
solc_version = "0.8.11" | ||
# Sets the concrete solc version to use | ||
# This overrides the `auto_detect_solc` value | ||
solc_version = '0.8.11' | ||
auto_detect_solc = false | ||
# Increase optimizer_runs | ||
optimizer = true | ||
optimizer_runs = 1_000 | ||
# Fuzz more than the default 256 | ||
fuzz_runs = 1_000 | ||
|
||
# See more config options https://github.com/gakonst/foundry/tree/master/config | ||
# Perform extreme fuzzing on CI runs | ||
[ci] | ||
fuzz_runs = 100_000 |
Oops, something went wrong.