Skip to content

Commit

Permalink
CI (#1)
Browse files Browse the repository at this point in the history
* Add Coverage report

* Update CI pipeline

* Update deps

* Update CI yaml

* Install deps

* Update CI

* Fix solhint

* Fix typechain

* Update CI

* Update CI

* Update detectors comments
  • Loading branch information
aviggiano authored Dec 12, 2023
1 parent 539487e commit 84d8631
Show file tree
Hide file tree
Showing 14 changed files with 2,661 additions and 38 deletions.
53 changes: 33 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: CI

on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main
pull_request:
branches:
- "*"

jobs:
foundry:
Expand Down Expand Up @@ -39,24 +38,19 @@ jobs:
forge test -vvv
id: test

- name: Coverage
run: |
forge coverage --ir-minimum --report lcov
lcov --remove lcov.info -o lcov.info 'test/*' 'script/*'
genhtml lcov.info -o report --branch-coverage
id: coverage

- name: Archive results
uses: actions/upload-artifact@v3
- uses: webfactory/[email protected]
with:
name: coverage
path: report/
ssh-private-key: ${{ secrets.SIZE_BOT_SSH_KEY }}

- name: Report coverage
uses: romeovs/[email protected]
with:
lcov-file: lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
if: github.ref == 'refs/heads/main'
run: |
git config --local user.email "[email protected]"
git config --local user.name "Size"
./script/update_readme_coverage.sh
git add README.md
git commit -m "Update coverage [skip ci]" || true
git push origin main
slither:
strategy:
Expand Down Expand Up @@ -91,6 +85,10 @@ jobs:
with:
submodules: recursive

- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SIZE_BOT_SSH_KEY }}

- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
Expand All @@ -99,8 +97,20 @@ jobs:
- name: Build
run: forge build

- name: Install dependencies
run: npm install

- name: Generate types
run: npx typechain --target ethers-v5 out/Size.sol/Size.json out/PriceFeed.sol/PriceFeed.json
run: npm run typechain

- name: Add typechain
if: github.ref == 'refs/heads/main'
run: |
git config --local user.email "[email protected]"
git config --local user.name "Size"
git add types/
git commit -m "Update types [skip ci]" || true
git push
solhint:
strategy:
Expand All @@ -113,5 +123,8 @@ jobs:
with:
submodules: recursive

- name: Install dependencies
run: npm install

- name: Run solhint
run: npx solhint src/**/*.sol --max-warnings 0
run: npm run solhint
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ bin/
coverage/
report/
lcov.info

# Npm
node_modules
3 changes: 3 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "solhint:default"
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

Size V2 Solidity

## Setup
## Coverage

Install <https://github.com/0xClandestine/solplot>
<!-- BEGIN_COVERAGE -->
<!-- END_COVERAGE -->

## Test

Expand Down
Loading

0 comments on commit 84d8631

Please sign in to comment.