From c9fc5217c7759e8da9f319c193c79ddab8ae11ee Mon Sep 17 00:00:00 2001 From: "John McClure (pickleback)" Date: Tue, 6 Aug 2024 23:10:21 -0500 Subject: [PATCH] addressing feedback: add workflows and fix comments --- .github/workflows/coverage.yml | 49 +++++++++++++++++++++++++++++ .github/workflows/test.yml | 10 +++--- Makefile | 14 +++++++++ contracts/internal/EverlongBase.sol | 8 +++-- 4 files changed, 74 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/coverage.yml create mode 100644 Makefile diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..2f12d48 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,49 @@ +name: Code Coverage + +on: + push: + pull_request: + merge_group: + +jobs: + coverage: + name: coverage + runs-on: ubuntu-latest-16core + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + cache: false + + - name: forge version + run: forge --version + + - name: Run coverage + run: | + make coverage + sudo apt-get install lcov + lcov --remove lcov.info -o lcov.info 'test/*' 'script/*' + + - name: Edit lcov.info + run: | + cat lcov.info | sed '/.*\/test\/.*/,/TN:/d' > tmp.info && mv tmp.info lcov.info + + - name: Coveralls + uses: coverallsapp/github-action@v2 + with: + path-to-lcov: "./lcov.info" + parallel: true + + finish: + needs: coverage + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v2 + with: + parallel-finished: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9282e82..35216f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,9 @@ name: test -on: workflow_dispatch +on: + push: + pull_request: + merge_group: env: FOUNDRY_PROFILE: ci @@ -24,11 +27,10 @@ jobs: - name: Run Forge build run: | - forge --version - forge build --sizes + make build id: build - name: Run Forge tests run: | - forge test -vvv + make test id: test diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..05863ad --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +.PHONY: build test + +### Build ### + +build: + forge build --force --sizes + +### Test ### + +test: + forge test + +coverage: + forge coverage --report lcov diff --git a/contracts/internal/EverlongBase.sol b/contracts/internal/EverlongBase.sol index 08e73d8..12c40b7 100644 --- a/contracts/internal/EverlongBase.sol +++ b/contracts/internal/EverlongBase.sol @@ -8,6 +8,8 @@ import { IEverlongEvents } from "../interfaces/IEverlongEvents.sol"; import { EVERLONG_KIND, EVERLONG_VERSION } from "../libraries/Constants.sol"; import { EverlongERC4626 } from "./EverlongERC4626.sol"; +// TODO: Reassess whether centralized configuration management makes sense. +// https://github.com/delvtech/everlong/pull/2#discussion_r1703799747 /// @author DELV /// @title EverlongBase /// @notice Base contract for Everlong. @@ -21,12 +23,12 @@ abstract contract EverlongBase is EverlongERC4626, IEverlongEvents { // │ Storage │ // ╰─────────────────────────────────────────────────────────╯ - /// Admin /// + // Admin // /// @dev Address of the contract admin. address internal _admin; - /// Hyperdrive /// + // Hyperdrive // /// @dev Address of the Hyperdrive instance wrapped by Everlong. address public immutable hyperdrive; @@ -35,7 +37,7 @@ abstract contract EverlongBase is EverlongERC4626, IEverlongEvents { // If false, use the Hyperdrive's `vaultSharesToken`. bool internal immutable _asBase; - /// Positions /// + // Positions // // TODO: Reassess using a more tailored data structure. /// @dev Utility data structure to manage the position queue.