gci: Split out installation of elements and bitcoin into a script

It was crowding the github workflow file
This commit is contained in:
Christian Decker 2022-12-22 15:38:45 +01:00 committed by Rusty Russell
parent 71b581da4d
commit e17611c570
2 changed files with 91 additions and 15 deletions

19
.github/scripts/install-bitcoind.sh vendored Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh
set -e
DIRNAME="bitcoin-${BITCOIN_VERSION}"
EDIRNAME="elements-${ELEMENTS_VERSION}"
FILENAME="${DIRNAME}-x86_64-linux-gnu.tar.bz2"
EFILENAME="${EDIRNAME}-x86_64-linux-gnu.tar.bz2"
cd /tmp/
wget "https://storage.googleapis.com/c-lightning-tests/$FILENAME"
wget -q "https://storage.googleapis.com/c-lightning-tests/${EFILENAME}"
tar -xaf "${FILENAME}"
tar -xaf "${EFILENAME}"
sudo mv "${DIRNAME}"/bin/* "/usr/local/bin"
sudo mv "${EDIRNAME}"/bin/* "/usr/local/bin"
rm -rf "${FILENAME}" "${EFILENAME}" "${DIRNAME}" "${EDIRNAME}"

View file

@ -213,21 +213,7 @@ jobs:
poetry install
- name: Install bitcoind
run: |
(
cd /tmp/
wget https://storage.googleapis.com/c-lightning-tests/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.bz2
wget -q https://storage.googleapis.com/c-lightning-tests/elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2
tar -xjf bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.bz2
tar -xjf elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2
sudo mv bitcoin-$BITCOIN_VERSION/bin/* /usr/local/bin
sudo mv elements-$ELEMENTS_VERSION/bin/* /usr/local/bin
rm -rf \
bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz \
bitcoin-$BITCOIN_VERSION \
elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2 \
elements-$ELEMENTS_VERSION
)
run: .github/scripts/install-bitcoind.sh
- name: Download build
uses: actions/download-artifact@v3
@ -249,6 +235,77 @@ jobs:
tar -xaf cln-${CFG}.tar.bz2
poetry run pytest tests/ -vvv -n ${PYTEST_PAR} ${PYTEST_OPTS}
integration-valgrind:
name: Valgrind Test CLN ${{ matrix.name }}
runs-on: ubuntu-22.04
env:
COMPAT: 1
BITCOIN_VERSION: 0.20.1
ELEMENTS_VERSION: 0.18.1.8
RUST_PROFILE: release # Has to match the one in the compile step
VALGRIND: 1
CFG: gcc-dev1-exp1
DEVELOPER: 1
EXPERIMENTAL_FEATURES: 1
PYTEST_OPTS: --test-group-random-seed=42
needs:
- compile
strategy:
fail-fast: true
matrix:
include:
- NAME: Valgrind (01/10)
PYTEST_OPTS: --test-group=1 --test-group-count=10
- NAME: Valgrind (02/10)
PYTEST_OPTS: --test-group=2 --test-group-count=10
- NAME: Valgrind (03/10)
PYTEST_OPTS: --test-group=3 --test-group-count=10
- NAME: Valgrind (04/10)
PYTEST_OPTS: --test-group=4 --test-group-count=10
- NAME: Valgrind (05/10)
PYTEST_OPTS: --test-group=5 --test-group-count=10
- NAME: Valgrind (06/10)
PYTEST_OPTS: --test-group=6 --test-group-count=10
- NAME: Valgrind (07/10)
PYTEST_OPTS: --test-group=7 --test-group-count=10
- NAME: Valgrind (08/10)
PYTEST_OPTS: --test-group=8 --test-group-count=10
- NAME: Valgrind (09/10)
PYTEST_OPTS: --test-group=9 --test-group-count=10
- NAME: Valgrind (10/10)
PYTEST_OPTS: --test-group=10 --test-group-count=10
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
run: |
pip3 install --user pip wheel poetry
poetry install
- name: Install bitcoind
run: .github/scripts/install-bitcoind.sh
- name: Download build
uses: actions/download-artifact@v3
with:
name: cln-${ CFG }.tar.bz2
- name: Test
env:
COMPAT: 1
SLOW_MACHINE: 1
TEST_DEBUG: 1
run: |
tar -xjf cln-${{ matrix.CFG }}.tar.bz2
sed -i 's/VALGRIND=0/VALGRIND=1/g' config.vars
poetry run pytest tests/ -vvv -n 5 ${PYTEST_OPTS} ${{ matrix.PYTEST_OPTS }}
gather:
# A dummy task that depends on the full matrix of tests, and
# signals successful completion. Used for the PR status to pass