Skip to content

Commit

Permalink
add ci script
Browse files Browse the repository at this point in the history
  • Loading branch information
valle-xyz committed Feb 12, 2024
1 parent 4000bbc commit f624e0a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 6 deletions.
48 changes: 43 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: test
name: Coinroutes Dex Integration | Solidity Quality Checks

on: workflow_dispatch
on:
push:
branches: ["main", "develop"]
pull_request:
branches: ["main", "develop"]
workflow_dispatch:

env:
FOUNDRY_PROFILE: ci
Expand All @@ -13,14 +18,19 @@ jobs:
name: Foundry project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: recursive
ref: ${{ github.event.pull_request.head.ref }}

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Forge Fmt Check
run: |
forge fmt --check
id: fmt_check

- name: Run Forge build
run: |
Expand All @@ -32,3 +42,31 @@ jobs:
run: |
forge test -vvv
id: test

- name: Run Code Coverage
run: |
forge coverage --report lcov
id: coverage

- name: Generate Coverage Report
uses: zgosalvez/github-actions-report-lcov@v1
with:
coverage-files: ./lcov.info
minimum-coverage: 95
artifact-name: code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Compare snapshot
run: NO_COLOR=1 forge snapshot >> $GITHUB_STEP_SUMMARY

- name: Run Forge Snapshot
run: |
forge snapshot
id: snapshot

- name: Add & Commit Snapshot
uses: EndBug/[email protected]
with:
default_author: github_actions
add: ".gas-snapshot"
message: "update gas snapshot"
2 changes: 1 addition & 1 deletion src/PriceFeed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ contract PriceFeed is IPriceFeed {

function _normalize(PythStructs.Price memory price) internal pure returns (int256) {
int32 expo = price.expo;
int64 priceVal = price.price;
int64 priceVal = price.price;f

require(priceVal >= 0, 'PriceFeed: oracle price is negative.');
require(expo <= 0, 'PriceFeed: exponent is not negative.');
Expand Down

0 comments on commit f624e0a

Please sign in to comment.