Skip to content

Commit c15a095

Browse files
committed
[feat] - add ci pipes and run linter against contracts;
1 parent 2365527 commit c15a095

File tree

9 files changed

+578
-126
lines changed

9 files changed

+578
-126
lines changed

Diff for: .github/codecov.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ignore:
2+
- "lib"
3+
- "test"
4+
- "test/BaseFixture.sol"
5+
- "test/Utils.sol"
6+
- "src/mocks"

Diff for: .github/workflows/forge_coverage.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
7+
name: coverage
8+
9+
env:
10+
FOUNDRY_PROFILE: ci
11+
12+
jobs:
13+
check:
14+
strategy:
15+
fail-fast: true
16+
17+
name: Forge Coverage
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
submodules: recursive
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v3
26+
27+
- name: Install hardhat & dependencies
28+
run: npm install
29+
30+
- name: Install Foundry
31+
uses: foundry-rs/foundry-toolchain@v1
32+
with:
33+
version: nightly
34+
35+
- name: Run Forge build
36+
run: |
37+
forge --version
38+
forge build --sizes
39+
40+
- name: Run Forge tests
41+
run: |
42+
forge coverage --fork-url ${{ secrets.ALCHEMY_RPC_URL }} --report lcov
43+
44+
- uses: codecov/codecov-action@v3
45+
with:
46+
token: ${{ secrets.CODECOV_TOKEN }}
47+
files: lcov.info
48+
fail_ci_if_error: false
49+
verbose: true

Diff for: .github/workflows/lint.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: lint
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- uses: actions/setup-node@v2
16+
with:
17+
node-version: 16.x
18+
19+
- name: Install Dependencies
20+
run: npm i --frozen-lockfile
21+
22+
- name: Prettier
23+
run: npm run prettier-check

Diff for: .github/workflows/test.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
env:
10+
FOUNDRY_PROFILE: ci
11+
12+
jobs:
13+
check:
14+
strategy:
15+
fail-fast: true
16+
17+
name: Foundry project
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
submodules: recursive
23+
24+
- name: Install Foundry
25+
uses: foundry-rs/foundry-toolchain@v1
26+
with:
27+
version: nightly
28+
29+
- name: Run Forge build
30+
run: |
31+
forge --version
32+
forge build --sizes
33+
id: build
34+
35+
- name: Run Forge tests
36+
run: |
37+
forge test -vvv --fork-url ${{ secrets.ALCHEMY_RPC_URL }}
38+
id: test

Diff for: .gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,7 @@ dist
102102

103103
# TernJS port file
104104
.tern-port
105+
106+
.idea
107+
out
108+
cache

Diff for: package-lock.json

+165
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"scripts": {
3+
"prettier": "prettier --write 'src/*.sol' 'test/*.sol'",
4+
"prettier-check": "prettier --check 'src/*.sol' 'test/*.sol'"
5+
},
6+
"devDependencies": {
7+
"prettier": "^2.6.2",
8+
"prettier-plugin-solidity": "^1.0.0-beta.19"
9+
}
10+
}

0 commit comments

Comments
 (0)