Skip to content

Commit

Permalink
GitHub workflow update (Python and Bitcoin Core versions)
Browse files Browse the repository at this point in the history
* Remove Python 3.6 (EOL), add Python 3.10.
* Add support for testing against multiple Bitcoin Core versions, add
  0.18.0 (oldest officially support for test suite) and 22.0 (latest
  stable release). Previously we tested against hardcoded 0.19.1. IMO
  testing against oldest supported and latest makes sense, if tests pass
  on both, they should pass on releases inbetween too, unless there is
  some behaviour affecting us changed twice.
* Update actions/cache from v2 to v3.

Also changed Core downloads from bitcoin.org to bitcoincore.org.
  • Loading branch information
kristapsk committed Oct 23, 2022
1 parent bb8cd00 commit 2e390ff
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ["3.7", "3.8", "3.9", "3.10"]
bitcoind-version: ["0.18.0", "22.0"]

steps:
- uses: actions/checkout@v2
Expand All @@ -18,7 +19,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache venv
id: cache-venv
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: venv
with:
Expand All @@ -35,16 +36,19 @@ jobs:
- name: Lint with flake8
run: ./jmvenv/bin/flake8 -v jmclient jmbase jmbitcoin jmdaemon scripts
- name: Cache bitcoind
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: bitcoind
BITCOIND_VERSION: ${{ matrix.bitcoind-version }}
with:
path: ~/bitcoin/*/bin/bitcoin*
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('test/testrunner/install_bitcoind.sh') }}
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.BITCOIND_VERSION }}-${{ hashFiles('test/testrunner/install_bitcoind.sh') }}
- name: Install bitcoind
env:
BITCOIND_VERSION: ${{ matrix.bitcoind-version }}
run: ./test/testrunner/install_bitcoind.sh
- name: Cache miniircd
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: miniircd
with:
Expand Down
6 changes: 6 additions & 0 deletions cmtdata/testnet_commitments.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"used": [
"0834e71cf505a2a220375199547298a71923b85ef34a4a2b707ee977e32ae5ba"
],
"external": {}
}
9 changes: 6 additions & 3 deletions test/testrunner/install_bitcoind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

set -ev

export BITCOIND_VERSION=0.19.1
if [[ -z "$BITCOIND_VERSION" ]]; then
echo "BITCOIND_VERSION must be set"
exit 1
fi

if sudo cp ~/bitcoin/bitcoin-$BITCOIND_VERSION/bin/bitcoind /usr/local/bin/bitcoind
then
echo "found cached bitcoind"
sudo cp ~/bitcoin/bitcoin-$BITCOIND_VERSION/bin/bitcoin-cli /usr/local/bin/bitcoin-cli
sudo cp ~/bitcoin/bitcoin-$BITCOIND_VERSION/bin/bitcoin-cli /usr/local/bin/bitcoin-cli
else
mkdir -p ~/bitcoin && \
pushd ~/bitcoin && \
wget https://bitcoin.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz && \
wget https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz && \
tar xvfz bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz && \
sudo cp ./bitcoin-$BITCOIND_VERSION/bin/bitcoind /usr/local/bin/bitcoind && \
sudo cp ./bitcoin-$BITCOIND_VERSION/bin/bitcoin-cli /usr/local/bin/bitcoin-cli && \
Expand Down

0 comments on commit 2e390ff

Please sign in to comment.