Skip to content

Commit

Permalink
fix foundry gh-actions (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
technophile-04 authored May 27, 2024
1 parent c17a7f0 commit 8365035
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-eagles-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-eth": patch
---

fix foundry gh-actions
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Lint
import { withDefaults } from "../../../utils.js";

const contents = ({ solidityEnvSetup }) =>
`name: Lint
on:
push:
Expand All @@ -10,7 +13,7 @@ on:
jobs:
ci:
runs-on: ${{ matrix.os }}
runs-on: \${{ matrix.os }}
strategy:
matrix:
Expand All @@ -24,20 +27,18 @@ jobs:
- name: Setup node env
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
node-version: \${{ matrix.node }}
cache: yarn
- name: Install dependencies
run: yarn install --immutable

- name: Run hardhat node, deploy contracts (& generate contracts typescript output)
run: yarn chain & yarn deploy

${solidityEnvSetup.filter(Boolean).join("\n")}
- name: Run nextjs lint
run: yarn next:lint --max-warnings=0
- name: Check typings on nextjs
run: yarn next:check-types
run: yarn next:check-types`;

- name: Run hardhat lint
run: yarn hardhat:lint --max-warnings=0
export default withDefaults(contents, {
solidityEnvSetup: undefined,
});
11 changes: 11 additions & 0 deletions templates/extensions/foundry/.github/workflows/lint.yaml.args.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const solidityEnvSetup = `
- name: Install foundry-toolchain
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run foundry node, deploy contracts (& generate contracts typescript output)
env:
ETHERSCAN_API_KEY: \${{ secrets.ETHERSCAN_API_KEY }}
run: yarn chain & yarn deploy
`;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const contents = () =>
`# Compiler files
const contents = () =>
`# Compiler files
cache/
out/
Expand All @@ -8,12 +8,16 @@ out/
/broadcast/*/31337/
/broadcast/**/dry-run/
# Ignore 31337 deployments
/deployments/31337.json
# Docs
docs/
# Dotenv file
.env
localhost.json
`
`;

export default contents;

export default contents

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const solidityEnvSetup = `
- name: Run hardhat node, deploy contracts (& generate contracts typescript output)
run: yarn chain & yarn deploy
- name: Run hardhat lint
run: yarn hardhat:lint --max-warnings=0
`;

0 comments on commit 8365035

Please sign in to comment.