PaulRBerg / hardhat-template

Hardhat-based template for developing Solidity smart contracts
MIT License
1.96k stars 559 forks source link

ci failing on initial commit #138

Closed devtooligan closed 2 years ago

devtooligan commented 2 years ago

Hey PRB, thanks for all you do!

I used this template for the first time in a while and ci is failing immediately on the first commit. The error is pretty opaque. Screen Shot 2022-09-12 at 10 20 20 AM

Does it have to do with this? 🤔

PaulRBerg commented 2 years ago

Hey @devtooligan! This might be due to the --immutable flag, which triggers an error when you modify a dependency in package.json but don't subsequently run yarn install to update the yarn.lock file. As per the yarn documentation's definition of --immutable:

Abort with an error exit code if the lockfile was to be modified

If this is not the reason, it might be useful to click "Fetch step" and "Link step" and report what you see. Pro tip: you can use the Markdown collapse feature to hide the report from automatically showing in your GitHub comment.

devtooligan commented 2 years ago
Woah that pro-tip! ❤️ It's really cool! ❤️

So what is the solution to this? I ran yarn install locally and it didn't seem to affect anything or update the yarn.lock. Should I remove the --immutable flag from the ci.yml file??

here's the Link and Fetch steps expanded if that helps ![Screen Shot 2022-09-12 at 2 16 11 PM](https://user-images.githubusercontent.com/71567643/189760619-6a1c150f-26e9-491f-a0e8-684ae30ee14e.png)
PaulRBerg commented 2 years ago

If running yarn install locally didn't update yarn.lock, then this isn't the reason why the CI error occurs.

As you can see on line 30, the problem is that you didn't set a MNEMONIC environment variable in your repo's GitHub secrets. This is explained in the README.

Side note: glad you like the Markdown collapse feature!

Side note 2: when you are ready to switch to Foundry, come take a look at my Foundry Template. It's similar to my Hardhat Template in many ways. But one of the advantages of using Foundry is that you no longer have to provide a mnemonic to start using the template.