Skip to content

Commit

Permalink
chore: Manage Forge dependencies as NPM packages (the Hardhat way)
Browse files Browse the repository at this point in the history
  • Loading branch information
alainncls committed Apr 20, 2024
1 parent a9cef41 commit d09b00a
Show file tree
Hide file tree
Showing 46 changed files with 1,358 additions and 1,530 deletions.
116 changes: 116 additions & 0 deletions .github/workflows/smart-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,34 @@ jobs:
with:
submodules: recursive

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

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

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

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

Expand Down Expand Up @@ -61,6 +89,34 @@ jobs:
with:
submodules: recursive

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

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

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

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

Expand All @@ -83,6 +139,34 @@ jobs:
with:
submodules: recursive

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

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

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

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

Expand Down Expand Up @@ -164,6 +248,38 @@ jobs:
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install Pnpm
if: steps.check-changes.outputs.changed == 'true'
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Install Node.js
if: steps.check-changes.outputs.changed == 'true'
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- name: Get pnpm store directory
if: steps.check-changes.outputs.changed == 'true'
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
if: steps.check-changes.outputs.changed == 'true'
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
if: steps.check-changes.outputs.changed == 'true'
run: pnpm install --frozen-lockfile
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ node_modules
lcov.info
coverage

# Hardhat
# Contarcts
cache_hardhat
cache_forge
artifacts
typechain-types

Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ build
.graphclient
snap
dist
cache_forge

# files
*.env
Expand Down
9 changes: 9 additions & 0 deletions contracts/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.openzeppelin
deployments
env
script
test
.env
foundry.toml
hardhat.config.ts
tsconfig.json
Loading

0 comments on commit d09b00a

Please sign in to comment.