From fa11bcea6e203a07e9e60f2d37b06e5d0555ea3a Mon Sep 17 00:00:00 2001 From: pawurb Date: Thu, 4 Jan 2024 09:46:40 +0100 Subject: [PATCH] Fix CI --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++++ README.md | 2 +- hardhat.config.ts.ci | 21 +++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml create mode 100644 hardhat.config.ts.ci diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7a4fc48 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: CI +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup + uses: actions/setup-node@v3 + with: + node-version: '18.x' + - run: npm i + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + - name: Run Linter + run: npm run lint + - name: Hardhat config + run: mv hardhat.config.ts.ci hardhat.config.ts + - name: Run Compile + run: npx hardhat compile + - name: Run node and tests + run: anvil & sleep 2 && npx hardhat test diff --git a/README.md b/README.md index 424092d..86cf27d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Locker - provides a way to lock and hold your ETH, ERC20 or ERC721 in a smart contract +# Locker - provides a way to lock and hold your ETH or ERC20 in a smart contract [![GH Actions](https://github.com/pawurb/Locker/actions/workflows/ci.yml/badge.svg)](https://github.com/pawurb/Locker/actions) **This is a BETA software that has not been audited for security. Incorrectly using these smart contracts can result in irreversible loss of your funds. USE AT YOUR OWN RISK!** diff --git a/hardhat.config.ts.ci b/hardhat.config.ts.ci new file mode 100644 index 0000000..3960cc0 --- /dev/null +++ b/hardhat.config.ts.ci @@ -0,0 +1,21 @@ +import { HardhatUserConfig } from "hardhat/config"; +import "@nomicfoundation/hardhat-toolbox"; + +const config: HardhatUserConfig = { + solidity: { + version: "0.8.17", + settings: { + optimizer: { + enabled: true, + runs: 200 + }, + } + }, + networks: { + hardhat: { + url: "http://127.0.0.1:8546" + } + } +}; + +export default config;