Skip to content

Commit

Permalink
feat(ci): makes services work
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajpiar committed May 7, 2024
1 parent 0f86a7f commit 663124b
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 18 deletions.
15 changes: 15 additions & 0 deletions .github/mining-test/bitcoind01.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
testnet=0
server=1
debug=1
listen=1
regtest=1
daemon=0
port=31591
rpcuser=admin
rpcpassword=admin
connect=localhost:31592
rpcbind=0.0.0.0:32591
rpcallowip=0.0.0.0/0
printtoconsole=1

peertimeout=999999
15 changes: 15 additions & 0 deletions .github/mining-test/bitcoind02.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
testnet=0
server=1
debug=1
listen=1
regtest=1
daemon=0
port=31592
rpcuser=admin
rpcpassword=admin
connect=localhost:31591
rpcbind=0.0.0.0:32592
rpcallowip=0.0.0.0/0
printtoconsole=1

peertimeout=999999
67 changes: 49 additions & 18 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,31 @@ jobs:
run:
working-directory: .

services:
bitcoind01:
image: kylemanna/bitcoind:latest
volumes:
- ${{ github.workspace }}/.github/mining-test/bitcoind01.conf:/etc/bitcoind/bitcoind.conf
env:
DISABLEWALLET: "0"
ports:
- 31591:31591
options: >-
--entrypoint "/usr/local/bin/bitcoind"
--conf "/etc/bitcoind/bitcoind.conf"

bitcoind02:
image: kylemanna/bitcoind:latest
volumes:
- ${{ github.workspace }}/.github/mining-test/bitcoind02.conf:/etc/bitcoind/bitcoind.conf
env:
DISABLEWALLET: "0"
ports:
- 31592:31592
options: >-
--entrypoint "/usr/local/bin/bitcoind"
--conf "/etc/bitcoind/bitcoind.conf"
steps:
- uses: actions/checkout@v2
- name: Setup System Tools
Expand Down Expand Up @@ -208,17 +233,23 @@ jobs:
# docker run -d --name bitcoind02 -p 31592:31592 --entrypoint "/usr/local/bin/bitcoind" kylemanna/bitcoind:latest -printtoconsole -regtest -debug -server -listen -port=31592 -connect=localhost:31591 -rpcbind=0.0.0.0:32592 -rpcallowip=0.0.0.0/0 -rpcuser=admin -rpcpassword=admin
#
#
# - name: Test bitcoin nodes
# run: |
# echo Test bitcoin node 1
# curl -s -u admin:admin --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://localhost:32591
# echo Test bitcoin node 2
# curl -s -u admin:admin --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://localhost:32592
#
# - name: Generate BTC blocks
# working-directory: mining-integration-tests
# run: |
# node generateBtcBlocks.js

- name: Restart bitcoin nodes
uses: docker://docker
with:
args: docker restart bitcoind01 bitcoind02

- name: Test bitcoin nodes
run: |
echo Test bitcoin node 1
curl -s -u admin:admin --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://bitcoind01:32591
echo Test bitcoin node 2
curl -s -u admin:admin --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://localhost:32592
- name: Generate BTC blocks
working-directory: mining-integration-tests
run: |
node generateBtcBlocks.js
- name: Setup Java JDK
uses: actions/setup-java@v2
Expand Down Expand Up @@ -263,15 +294,15 @@ jobs:
# run: |
#

- name: Run Mining Integration Tests
run: |
chmod +x .github/mining-test/run.sh
./.github/mining-test/run.sh
# - name: Run Mining Integration Tests
# working-directory: mining-integration-tests
# run: |
# npm test
# chmod +x .github/mining-test/run.sh
# ./.github/mining-test/run.sh

- name: Run Mining Integration Tests
working-directory: mining-integration-tests
run: |
npm test
- name: Stop RSKj
if: always()
Expand Down

0 comments on commit 663124b

Please sign in to comment.