Skip to content

Commit

Permalink
build: install core as package and bump it to v1.1.1
Browse files Browse the repository at this point in the history
build: remove git modules
chore: update remappings and imports accordingly
ci: cache the node_modules in build job to re-use it other jobs
  • Loading branch information
andreivladbrg committed Dec 15, 2023
1 parent 9068add commit d66e1b9
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 94 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/ci-deep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,24 @@ jobs:
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Install Pnpm"
uses: "pnpm/action-setup@v2"
with:
version: "8"

- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
cache: "pnpm"
node-version: "lts/*"

- name: "Install the Node.js dependencies"
run: "pnpm install"

- name: "Produce an optimized build with --via-ir"
run: "FOUNDRY_PROFILE=optimized forge build"

Expand Down
95 changes: 22 additions & 73 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ jobs:
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"
Expand Down Expand Up @@ -80,12 +78,13 @@ jobs:
- name: "Build the test contracts"
run: "FOUNDRY_PROFILE=test-optimized forge build"

- name: "Cache the build so that it can be re-used by the other jobs"
- name: "Cache the build and the node modules so that they can be re-used by the other jobs"
uses: "actions/cache/save@v3"
with:
key: "foundry-build-${{ github.sha }}"
key: "build-and-modules-${{ github.sha }}"
path: |
cache
node_modules
out
out-optimized
Expand All @@ -106,33 +105,18 @@ jobs:
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Install Pnpm"
uses: "pnpm/action-setup@v2"
with:
version: "8"

- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
cache: "pnpm"
node-version: "lts/*"

- name: "Install the Node.js dependencies"
run: "pnpm install"

- name: "Restore the cached build"
- name: "Restore the cached build and the node modules"
uses: "actions/cache/restore@v3"
with:
fail-on-cache-miss: true
key: "foundry-build-${{ github.sha }}"
key: "build-and-modules-${{ github.sha }}"
path: |
cache
node_modules
out
out-optimized
Expand All @@ -150,33 +134,18 @@ jobs:
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Install Pnpm"
uses: "pnpm/action-setup@v2"
with:
version: "8"

- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
cache: "pnpm"
node-version: "lts/*"

- name: "Install the Node.js dependencies"
run: "pnpm install"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Restore the cached build"
- name: "Restore the cached build and the node modules"
uses: "actions/cache/restore@v3"
with:
fail-on-cache-miss: true
key: "foundry-build-${{ github.sha }}"
key: "build-and-modules-${{ github.sha }}"
path: |
cache
node_modules
out
out-optimized
Expand All @@ -194,33 +163,18 @@ jobs:
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Install Pnpm"
uses: "pnpm/action-setup@v2"
with:
version: "8"

- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
cache: "pnpm"
node-version: "lts/*"

- name: "Install the Node.js dependencies"
run: "pnpm install"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Restore the cached build"
- name: "Restore the cached build and the node modules"
uses: "actions/cache/restore@v3"
with:
fail-on-cache-miss: true
key: "foundry-build-${{ github.sha }}"
key: "build-and-modules-${{ github.sha }}"
path: |
cache
node_modules
out
out-optimized
Expand All @@ -241,23 +195,18 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Install Pnpm"
uses: "pnpm/action-setup@v2"
with:
version: "8"
uses: "actions/checkout@v3"

- name: "Install Node.js"
uses: "actions/setup-node@v3"
- name: "Restore the cached build and the node modules"
uses: "actions/cache/restore@v3"
with:
cache: "pnpm"
node-version: "lts/*"

- name: "Install the Node.js dependencies"
run: "pnpm install"
fail-on-cache-miss: true
key: "build-and-modules-${{ github.sha }}"
path: |
cache
node_modules
out
out-optimized
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion lib/v2-core
Submodule v2-core deleted from 366c33
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@openzeppelin/contracts": "4.9.2",
"@prb/math": "4.0.2",
"@sablier/v2-core": "1.0.2"
"@sablier/v2-core": "1.1.1"
},
"devDependencies": {
"@prb/test": "0.6.4",
Expand All @@ -24,6 +24,7 @@
"files": [
"artifacts",
"src",
"test/utils",
"CHANGELOG.md"
],
"homepage": "https://github.com/sablier-labs/v2-periphery#readme",
Expand All @@ -48,7 +49,7 @@
"web3"
],
"peerDependencies": {
"@sablier/v2-core": "1.0.2"
"@sablier/v2-core": "1.1.1"
},
"publishConfig": {
"access": "public"
Expand Down
11 changes: 5 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/
@prb/math/=node_modules/@prb/math/
@prb/test/=node_modules/@prb/test/
@sablier/v2-core/=lib/v2-core/
@sablier/v2-core-test/=lib/v2-core/test/
@sablier/v2-core/=node_modules/@sablier/v2-core/
forge-std/=node_modules/forge-std/
solady/=node_modules/solady/
4 changes: 2 additions & 2 deletions test/Base.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { ISablierV2LockupDynamic } from "@sablier/v2-core/src/interfaces/ISablie
import { ISablierV2LockupLinear } from "@sablier/v2-core/src/interfaces/ISablierV2LockupLinear.sol";
import { LockupDynamic, LockupLinear } from "@sablier/v2-core/src/types/DataTypes.sol";

import { Assertions as V2CoreAssertions } from "@sablier/v2-core-test/utils/Assertions.sol";
import { Utils as V2CoreUtils } from "@sablier/v2-core-test/utils/Utils.sol";
import { Assertions as V2CoreAssertions } from "@sablier/v2-core/test/utils/Assertions.sol";
import { Utils as V2CoreUtils } from "@sablier/v2-core/test/utils/Utils.sol";

import { ISablierV2Batch } from "src/interfaces/ISablierV2Batch.sol";
import { ISablierV2MerkleStreamerFactory } from "src/interfaces/ISablierV2MerkleStreamerFactory.sol";
Expand Down
4 changes: 2 additions & 2 deletions test/fork/Fork.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ pragma solidity >=0.8.19 <0.9.0;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// import { ISablierV2LockupDynamic } from "@sablier/v2-core/src/interfaces/ISablierV2LockupDynamic.sol";
// import { ISablierV2LockupLinear } from "@sablier/v2-core/src/interfaces/ISablierV2LockupLinear.sol";
import { Precompiles as V2CorePrecompiles } from "@sablier/v2-core-test/utils/Precompiles.sol";
import { Precompiles as V2CorePrecompiles } from "@sablier/v2-core/test/utils/Precompiles.sol";

import { Fuzzers as V2CoreFuzzers } from "@sablier/v2-core-test/utils/Fuzzers.sol";
import { Fuzzers as V2CoreFuzzers } from "@sablier/v2-core/test/utils/Fuzzers.sol";

import { Defaults } from "../utils/Defaults.sol";
import { Base_Test } from "../Base.t.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/integration/Integration.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.19 <0.9.0;

import { Precompiles as V2CorePrecompiles } from "@sablier/v2-core-test/utils/Precompiles.sol";
import { Precompiles as V2CorePrecompiles } from "@sablier/v2-core/test/utils/Precompiles.sol";

import { Defaults } from "../utils/Defaults.sol";
import { Base_Test } from "../Base.t.sol";
Expand Down

0 comments on commit d66e1b9

Please sign in to comment.