Skip to content

Commit

Permalink
update to v0.2.2 (#3)
Browse files Browse the repository at this point in the history
* update from cryptogarageinc v0.2.4 + CI

* fix: docker image name

Co-authored-by: k-matsuzawa <[email protected]>
  • Loading branch information
ko-matsu and k-matsuzawa authored Nov 21, 2020
1 parent b8ec6e6 commit 5c3776b
Show file tree
Hide file tree
Showing 32 changed files with 2,736 additions and 118 deletions.
49 changes: 40 additions & 9 deletions .github/workflows/check_pre-merge_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ on:
- develop
- test_ci

env:
GITHUB_VERSION: v0.0.5
DOCKER_PYTHON_VERSION: 3.7
GITHUB_DOCKER_IMAGE: docker.pkg.github.com/cryptogarageinc/elements-testing-dockerfile/elements-testing
ENTRYPOINT_PATH: /github/workspace/.github/workflows/docker/test_entrypoint.sh

jobs:
build-and-test:
name: build & test
Expand All @@ -21,10 +27,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
py-ver: [3.6, 3.7, 3.8, pypy3]
os: [macos-10.15, windows-2019, ubuntu-18.04]
py-ver: [3.6, 3.7, 3.8, 3.9, pypy3]
exclude:
- os: windows-latest
- os: windows-2019
py-ver: pypy3

steps:
Expand Down Expand Up @@ -53,14 +59,16 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
py-ver: [3.6, 3.7, 3.8, pypy3]
os: [macos-10.15, macos-11.0, windows-2019, ubuntu-18.04, ubuntu-20.04]
py-ver: [3.6, 3.7, 3.8, 3.9, pypy3]
exclude:
- os: windows-latest
- os: windows-2019
py-ver: 3.6
- os: windows-latest
- os: windows-2019
py-ver: 3.7
- os: windows-latest
- os: windows-2019
py-ver: pypy3
- os: macos-11.0
py-ver: pypy3

steps:
Expand All @@ -80,9 +88,32 @@ jobs:
- name: call example
run: python ./tools/example.py

e2e-test:
timeout-minutes: 20
name: e2e-test
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.DOCKER_PYTHON_VERSION }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: install pip
run: python -m pip install -U pip
- name: create wheel
run: pip wheel .
- name: e2e-test
run: |
docker login docker.pkg.github.com -u owner -p ${{ secrets.GITHUB_TOKEN }}
docker pull ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_VERSION }}
docker run -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_VERSION }}
doxygen-ubuntu:
name: doxygen-ubuntu
runs-on: ubuntu-latest
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: install_doxygen
Expand Down
52 changes: 43 additions & 9 deletions .github/workflows/check_pre-merge_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ on:
push:
branches:
- master
paths-ignore:
- '.github/workflows/create_release-and-upload.yml'
- 'README.md'
pull_request:
branches:
- master

env:
GITHUB_VERSION: v0.0.5
DOCKER_PYTHON_VERSION: 3.7
GITHUB_DOCKER_IMAGE: docker.pkg.github.com/cryptogarageinc/elements-testing-dockerfile/elements-testing
ENTRYPOINT_PATH: /github/workspace/.github/workflows/docker/test_entrypoint.sh

jobs:
build-and-test:
name: build & test
Expand All @@ -16,10 +25,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
py-ver: [3.6, 3.7, 3.8, pypy3]
os: [macos-10.15, windows-2019, ubuntu-18.04]
py-ver: [3.6, 3.7, 3.8, 3.9, pypy3]
exclude:
- os: windows-latest
- os: windows-2019
py-ver: pypy3

steps:
Expand Down Expand Up @@ -48,14 +57,16 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
py-ver: [3.6, 3.7, 3.8, pypy3]
os: [macos-10.15, macos-11.0, windows-2019, ubuntu-18.04, ubuntu-20.04]
py-ver: [3.6, 3.7, 3.8, 3.9, pypy3]
exclude:
- os: windows-latest
- os: windows-2019
py-ver: 3.6
- os: windows-latest
- os: windows-2019
py-ver: 3.7
- os: windows-latest
- os: windows-2019
py-ver: pypy3
- os: macos-11.0
py-ver: pypy3

steps:
Expand All @@ -75,9 +86,32 @@ jobs:
- name: call example
run: python ./tools/example.py

e2e-test:
timeout-minutes: 20
name: e2e-test
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.DOCKER_PYTHON_VERSION }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: install pip
run: python -m pip install -U pip
- name: create wheel
run: pip wheel .
- name: e2e-test
run: |
docker login docker.pkg.github.com -u owner -p ${{ secrets.GITHUB_TOKEN }}
docker pull ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_VERSION }}
docker run -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_VERSION }}
doxygen-ubuntu:
name: doxygen-ubuntu
runs-on: ubuntu-latest
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: install_doxygen
Expand Down
45 changes: 38 additions & 7 deletions .github/workflows/check_pre-merge_sprint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ on:
branches:
- features/sprint*

env:
GITHUB_VERSION: v0.0.5
DOCKER_PYTHON_VERSION: 3.7
GITHUB_DOCKER_IMAGE: docker.pkg.github.com/cryptogarageinc/elements-testing-dockerfile/elements-testing
ENTRYPOINT_PATH: /github/workspace/.github/workflows/docker/test_entrypoint.sh

jobs:
build-and-test:
name: build & test
Expand All @@ -19,16 +25,18 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
py-ver: [3.6, 3.7, 3.8, pypy3]
os: [macos-10.15, windows-2019, ubuntu-18.04]
py-ver: [3.6, 3.7, 3.8, 3.9, pypy3]
exclude:
- os: macos-latest
- os: macos-10.15
py-ver: 3.6
- os: macos-latest
- os: macos-10.15
py-ver: 3.7
- os: windows-latest
- os: macos-10.15
py-ver: 3.8
- os: windows-2019
py-ver: 3.6
- os: windows-latest
- os: windows-2019
py-ver: pypy3

steps:
Expand All @@ -50,9 +58,32 @@ jobs:
- name: test
run: python -m unittest discover -v tests

e2e-test:
timeout-minutes: 20
name: e2e-test
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.DOCKER_PYTHON_VERSION }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: install pip
run: python -m pip install -U pip
- name: create wheel
run: pip wheel .
- name: e2e-test
run: |
docker login docker.pkg.github.com -u owner -p ${{ secrets.GITHUB_TOKEN }}
docker pull ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_VERSION }}
docker run -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_VERSION }}
doxygen-ubuntu:
name: doxygen-ubuntu
runs-on: ubuntu-latest
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: install_doxygen
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/code_scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
jobs:
analyze-CodeQL:
name: CodeQL
runs-on: ubuntu-latest
runs-on: ubuntu-18.04

strategy:
fail-fast: false
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
OSSAR-Scan:
# OSSAR runs on windows-latest.
# ubuntu-latest and macos-latest support coming soon
runs-on: windows-latest
runs-on: windows-2019

steps:
# Checkout your code repository to scan
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/create_release-and-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
create_releases:
name: create-releases
runs-on: ubuntu-latest
runs-on: ubuntu-18.04
outputs:
release_url: ${{ steps.output_url.outputs.upload_url }}

Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
name: upload-sdist
needs: create_releases
timeout-minutes: 20
runs-on: ubuntu-latest
runs-on: ubuntu-18.04

steps:
- name: checkout
Expand Down Expand Up @@ -109,15 +109,15 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-10.15, windows-latest, ubuntu-18.04]
os: [macos-10.15, windows-2019, ubuntu-18.04]
include:
- os: macos-10.15
py-ver: 3.6
pl-name: macosx_10_15_x86_64
- os: ubuntu-18.04
py-ver: 3.6
pl-name: linux_x86_64
- os: windows-latest
- os: windows-2019
py-ver: 3.8
pl-name: win_amd64

Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/docker/test_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash -u

# while :; do sleep 10; done
export WORKDIR_ROOT=github
export WORK_DIR=workspace
export WORKDIR_PATH=/${WORKDIR_ROOT}/${WORK_DIR}

cd /${WORKDIR_ROOT}
if [ ! -d ${WORK_DIR} ]; then
mkdir ${WORK_DIR}
fi

cd ${WORKDIR_PATH}
rm -rf bitcoind_datadir
rm -rf elementsd_datadir

mkdir bitcoind_datadir
chmod 777 bitcoind_datadir
# cp /root/.bitcoin/bitcoin.conf bitcoind_datadir/
cp ./integration_test/bitcoin.conf bitcoind_datadir/
mkdir elementsd_datadir
chmod 777 elementsd_datadir
# cp /root/.elements/elements.conf elementsd_datadir/
cp ./integration_test/elements.conf elementsd_datadir/

# boot daemon
bitcoind --regtest -datadir=${WORKDIR_PATH}/bitcoind_datadir
bitcoin-cli --regtest -datadir=${WORKDIR_PATH}/bitcoind_datadir ping > /dev/null 2>&1
while [ $? -ne 0 ]
do
bitcoin-cli --regtest -datadir=${WORKDIR_PATH}/bitcoind_datadir ping > /dev/null 2>&1
done
echo "start bitcoin node"

elementsd -chain=liquidregtest -datadir=${WORKDIR_PATH}/elementsd_datadir
elements-cli -chain=liquidregtest -datadir=${WORKDIR_PATH}/elementsd_datadir ping > /dev/null 2>&1
while [ $? -ne 0 ]
do
elements-cli -chain=liquidregtest -datadir=${WORKDIR_PATH}/elementsd_datadir ping > /dev/null 2>&1
done
echo "start elements node"

set -e

python3 --version

pip3 install *.whl
pip3 install python-bitcoinrpc

cd integration_test

python3 tests/test_bitcoin.py -v
if [ $? -gt 0 ]; then
cd ../..
exit 1
fi

python3 tests/test_elements.py -v
if [ $? -gt 0 ]; then
cd ../..
exit 1
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,6 @@ cmake_build/
/doc/latex
/**/*_localdebug.bat
/*.whl
/integration_test/localdata
/integration_test/bitcoind_datadir
/integration_test/elementsd_datadir
Loading

0 comments on commit 5c3776b

Please sign in to comment.