Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/setup-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e

# Add environment setup commands here

mkdir bin
# this is a dirty node release, we should use the anvil one with they are available
# Download eth-rpc binary
curl -L https://github.com/paritytech/hardhat-polkadot/releases/download/nodes-19631614896/eth-rpc-linux-x64 -o bin/eth-rpc
chmod +x bin/eth-rpc
# Download revive-dev-node binary
curl -L https://github.com/paritytech/hardhat-polkadot/releases/download/nodes-19631614896/revive-dev-node-linux-x64 -o bin/dev-node
chmod +x bin/dev-node
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Hardhat Tests

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Setup environment
run: ./.github/setup-env.sh

- name: Compile contracts
run: npx hardhat compile

- name: Run tests
run: npx hardhat test
5 changes: 0 additions & 5 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ const config: HardhatUserConfig = {
polkadot: true,
url: `http://127.0.0.1:8545`,
},
polkadotHubTestnet: {
polkadot: true,
url: "https://testnet-passet-hub-eth-rpc.polkadot.io",
accounts: [vars.get("PRIVATE_KEY")],
},
},
preprocess: {
eachLine: (hre) => ({
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "hardhat test",
"compile": "hardhat compile"
},
"author": "",
"license": "ISC",
Expand Down