Skip to content

Commit 98fda55

Browse files
authored
CI Pipeline (#8)
* hardhat CI pipieline package.json updates * remove polkadot hub from networks * remove master branch from CI
1 parent c34095e commit 98fda55

File tree

4 files changed

+50
-6
lines changed

4 files changed

+50
-6
lines changed

.github/setup-env.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Add environment setup commands here
5+
6+
mkdir bin
7+
# this is a dirty node release, we should use the anvil one with they are available
8+
# Download eth-rpc binary
9+
curl -L https://github.com/paritytech/hardhat-polkadot/releases/download/nodes-19631614896/eth-rpc-linux-x64 -o bin/eth-rpc
10+
chmod +x bin/eth-rpc
11+
# Download revive-dev-node binary
12+
curl -L https://github.com/paritytech/hardhat-polkadot/releases/download/nodes-19631614896/revive-dev-node-linux-x64 -o bin/dev-node
13+
chmod +x bin/dev-node

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Hardhat Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
with:
17+
submodules: recursive
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: "22"
23+
cache: "npm"
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Setup environment
29+
run: ./.github/setup-env.sh
30+
31+
- name: Compile contracts
32+
run: npx hardhat compile
33+
34+
- name: Run tests
35+
run: npx hardhat test

hardhat.config.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ const config: HardhatUserConfig = {
3030
polkadot: true,
3131
url: `http://127.0.0.1:8545`,
3232
},
33-
polkadotHubTestnet: {
34-
polkadot: true,
35-
url: "https://testnet-passet-hub-eth-rpc.polkadot.io",
36-
accounts: [vars.get("PRIVATE_KEY")],
37-
},
3833
},
3934
preprocess: {
4035
eachLine: (hre) => ({

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"test": "hardhat test",
8+
"compile": "hardhat compile"
89
},
910
"author": "",
1011
"license": "ISC",

0 commit comments

Comments
 (0)