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 70a641d commit 22c8458
Show file tree
Hide file tree
Showing 66 changed files with 1,409 additions and 1,584 deletions.
124 changes: 120 additions & 4 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 Expand Up @@ -197,16 +313,16 @@ jobs:
if: steps.check-changes.outputs.changed == 'true'
run: pnpm run check:upgradeability linea

- name: Create Arbitrum testnet env file
- name: Create Arbitrum Sepolia env file
if: steps.check-changes.outputs.changed == 'true'
run: |
rm .env
cp ./env/.env.arbitrum-goerli .env
cp ./env/.env.arbitrum-sepolia .env
echo INFURA_KEY=${{ secrets.INFURA_KEY }} >> .env
- name: Check contracts upgradeability on Arbitrum testnet
- name: Check contracts upgradeability on Arbitrum Sepolia
if: steps.check-changes.outputs.changed == 'true'
run: pnpm run check:upgradeability arbitrum-goerli
run: pnpm run check:upgradeability arbitrum-sepolia

- name: Create Arbitrum mainnet env file
if: steps.check-changes.outputs.changed == 'true'
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 22c8458

Please sign in to comment.