diff --git a/.github/scripts/install-bitcoind.sh b/.github/scripts/install-bitcoind.sh new file mode 100755 index 000000000..b27346440 --- /dev/null +++ b/.github/scripts/install-bitcoind.sh @@ -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}" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0555de4fd..2beea24ad 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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