Skip to content

Commit

Permalink
update ci (#3)
Browse files Browse the repository at this point in the history
* update ci

* update ci name

* upload miner config

* update log for ci
  • Loading branch information
gpBlockchain authored Sep 9, 2024
1 parent d7f8e07 commit 02dc1f7
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: miner integration test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose

- name: download ckb
run: |
# todo change version :117 use latest version
wget https://github.com/nervosnetwork/ckb/releases/download/v0.117.0/ckb_v0.117.0_x86_64-unknown-linux-gnu-portable.tar.gz
tar -zxvf ckb_v0.117.0_x86_64-unknown-linux-gnu-portable.tar.gz
cp ckb_v0.117.0_x86_64-unknown-linux-gnu-portable/ckb test
- name: run ckb
run: |
cargo run --bin ckb-mock-miner-server -- -b 0.0.0.0:3000 -p ./mock.json > mock.log 2>&1 &
- name: miner
run: |
cd test
# todo change 5 for mock.json size ,add timeout
./ckb miner -l 5
cat ../mock.log
42 changes: 42 additions & 0 deletions test/ckb-miner.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Config generated by `ckb init --chain mainnet`

data_dir = "data"

[chain]
# Choose the kind of chains to run, possible values:
# - { file = "specs/dev.toml" }
# - { bundled = "specs/testnet.toml" }
# - { bundled = "specs/mainnet.toml" }
spec = { bundled = "specs/mainnet.toml" }

[logger]
filter = "info"
color = true
log_to_file = true
log_to_stdout = true

[sentry]
# set to blank to disable sentry error collection
dsn = ""
# if you are willing to help us to improve,
# please leave a way to contact you when we have troubles to reproduce the errors.
# org_contact = ""

# # **Experimental** Monitor memory changes.
# [memory_tracker]
# # Seconds between checking the process, 0 is disable, default is 0.
# interval = 600

[miner.client]
rpc_url = "http://127.0.0.1:3000/"
block_on_submit = true

# block template polling interval in milliseconds
poll_interval = 1000

# enable listen notify mode
# listen = "127.0.0.1:8888"

[[miner.workers]]
worker_type = "EaglesongSimple"
threads = 1

0 comments on commit 02dc1f7

Please sign in to comment.