Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
c98tristan committed Mar 13, 2024
1 parent 1846451 commit bb4b904
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 79 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- develop
- chore/github-action

jobs:
build:
runs-on: [self-hosted, Linux]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup node.js environment
uses: actions/setup-node@v1
with:
node-version: "18"

- name: Install dependencies
run: |
npm i
- name: Compile
run: |
npx hardhat compile
- name: Test
run: |
npx hardhat test --parallel
163 changes: 84 additions & 79 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,85 +10,90 @@ const infuraKey = process.env.INFURA_API_KEY || "";
const etherscanApi = process.env.ETHERSCAN_API_KEY || "";

const config: HardhatUserConfig = {
solidity: {
version: "0.8.9",
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
evmVersion: "byzantium",
metadata: {
// do not include the metadata hash, since this is machine dependent
// and we want all generated code to be deterministic
// https://docs.soliditylang.org/en/v0.7.6/metadata.html
bytecodeHash: "none",
},
},
},
networks: {
hardhat: {
allowUnlimitedContractSize: false,
},
mainnet: {
url: `https://mainnet.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
goerli: {
url: `https://goerli.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
sepolia: {
url: `https://sepolia.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
arbitrumRinkeby: {
url: `https://arbitrum-rinkeby.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
arbitrum: {
url: `https://arbitrum-mainnet.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
bnb: {
url: `https://bsc-dataseed.binance.org/`,
accounts: [privateKey],
},
mumbai: {
url: `https://polygon-mumbai.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
optimism: {
url: `https://optimism-mainnet.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
optimismKovan: {
url: `https://optimism-kovan.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
polygon: {
url: `https://polygon-mainnet.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
myNetwork: {
url: "http://127.0.0.1:1545",
accounts: [privateKey],
gas: 300000000,
},
},
etherscan: {
apiKey: etherscanApi,
},
paths: {
artifacts: "./artifacts",
cache: "./cache",
// deploy: "./deploy",
sources: "./contracts",
// tests: "./tests",
},
mocha: {
timeout: 60000,
},
solidity: {
version: "0.8.9",
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
// evmVersion: "byzantium",
metadata: {
// do not include the metadata hash, since this is machine dependent
// and we want all generated code to be deterministic
// https://docs.soliditylang.org/en/v0.7.6/metadata.html
bytecodeHash: "none",
},
},
},
networks: {
hardhat: {
allowUnlimitedContractSize: false,
},
mainnet: {
url: `https://mainnet.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
goerli: {
url: `https://goerli.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
sepolia: {
url: `https://sepolia.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
arbitrumRinkeby: {
url: `https://arbitrum-rinkeby.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
arbitrum: {
url: `https://arbitrum-mainnet.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
bnb: {
url: `https://bsc-dataseed.binance.org/`,
accounts: [privateKey],
},
mumbai: {
url: `https://polygon-mumbai.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
optimism: {
url: `https://optimism-mainnet.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
optimismKovan: {
url: `https://optimism-kovan.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
polygon: {
url: `https://polygon-mainnet.infura.io/v3/${infuraKey}`,
accounts: [privateKey],
},
myNetwork: {
url: "http://127.0.0.1:1545",
accounts: [privateKey],
gas: 300000000,
},
bitkub: {
url: `https://rpc-testnet.bitkubchain.io`,
accounts: [privateKey],
gas: 300000000,
},
},
etherscan: {
apiKey: etherscanApi,
},
paths: {
artifacts: "./artifacts",
cache: "./cache",
// deploy: "./deploy",
sources: "./contracts",
// tests: "./tests",
},
mocha: {
timeout: 60000,
},
};

export default config;

0 comments on commit bb4b904

Please sign in to comment.