Skip to content

Dockerfile: Update lightningd base image to a version that actually exists #2113

Dockerfile: Update lightningd base image to a version that actually exists

Dockerfile: Update lightningd base image to a version that actually exists #2113

Workflow file for this run

name: Integration Tests (latest)
# Cancel duplicate jobs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
push:
branches: [ master ]
pull_request:
jobs:
build-and-test:
name: Test PY=${{ matrix.python-version }}, BCD=${{ matrix.bitcoind-version }}, EXP=${{ matrix.experimental }}, DEP=${{ matrix.deprecated }}
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
bitcoind-version: ["26.0"]
experimental: [1]
deprecated: [0]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get changed files
id: get_changed_files
if: ${{ github.event_name == 'pull_request' }}
uses: tj-actions/changed-files@v44
with:
files: '**/*'
files_ignore: |
*.md
*.toml
*.yml
*.lock
Dockerfile
.gitignore
LICENSE
archived/**
- name: Set plugin_dirs
id: set_plugin_dirs
if: ${{ github.event_name == 'pull_request' }}
run: |
changed_files=$(echo "${{ steps.get_changed_files.outputs.all_changed_files }}" | tr ',' '\n')
plugin_dirs=""
for file in $changed_files; do
dir=$(dirname "$file" | cut -d'/' -f1)
if [[ "$dir" != "." && "${dir:0:1}" != "." && ! " ${plugin_dirs[@]} " =~ " ${dir} " ]]; then
plugin_dirs="${plugin_dirs} ${dir}"
fi
done
echo "plugin_dirs=${plugin_dirs}" >> "$GITHUB_OUTPUT"
if [[ -n "${{ steps.get_changed_files.outputs.all_changed_files }}" ]]; then
echo "run_ci=true" >> "$GITHUB_OUTPUT"
else
echo "run_ci=false" >> "$GITHUB_OUTPUT"
fi
- name: Download Bitcoin ${{ matrix.bitcoind-version }} & install binaries
if: ${{ github.event_name == 'push' || steps.set_plugin_dirs.outputs.run_ci == 'true' }}
run: |
export BITCOIND_VERSION=${{ matrix.bitcoind-version }}
wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIND_VERSION}/bitcoin-${BITCOIND_VERSION}-x86_64-linux-gnu.tar.gz
tar -xzf bitcoin-${BITCOIND_VERSION}-x86_64-linux-gnu.tar.gz
sudo mv bitcoin-${BITCOIND_VERSION}/bin/* /usr/local/bin
rm -rf bitcoin-${BITCOIND_VERSION}-x86_64-linux-gnu.tar.gz bitcoin-${BITCOIND_VERSION}
- name: Download Core Lightning latest & install binaries
if: ${{ github.event_name == 'push' || steps.set_plugin_dirs.outputs.run_ci == 'true' }}
id: cln-latest-install
run: |
url=$(curl -s https://api.github.com/repos/ElementsProject/lightning/releases/latest \
| jq '.assets[] | select(.name | contains("22.04")) | .browser_download_url' \
| tr -d '\"')
wget $url
sudo tar -xvf ${url##*/} -C /usr/local --strip-components=2
echo "CLN_VERSION=$(lightningd --version)" >> "$GITHUB_OUTPUT"
- name: Checkout Core Lightning latest
if: ${{ github.event_name == 'push' || steps.set_plugin_dirs.outputs.run_ci == 'true' }}
uses: actions/checkout@v4
with:
repository: 'ElementsProject/lightning'
path: 'lightning'
ref: ${{ steps.cln-latest-install.outputs.CLN_VERSION }}
fetch-depth: 0 # Fetch all history for all branches and tags
submodules: 'recursive'
- name: Install Core Lightning Python package dependencies
if: ${{ github.event_name == 'push' || steps.set_plugin_dirs.outputs.run_ci == 'true' }}
run: |
sudo apt-get install -y \
python3 \
python3-pip \
cd lightning
pip3 install --user -U \
pip \
poetry \
wheel \
blinker \
pytest-custom-exit-code==0.3.0 \
pytest-json-report
poetry install
poetry update
poetry export --without-hashes -f requirements.txt --output requirements.txt
pip install --user -U -r requirements.txt
pip install --user contrib/pyln-client contrib/pyln-testing flaky
- name: Set up Python ${{ matrix.python-version }}
if: ${{ github.event_name == 'push' || steps.set_plugin_dirs.outputs.run_ci == 'true' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run pytest tests
id: pytest_tests
if: ${{ github.event_name == 'push' || steps.set_plugin_dirs.outputs.run_ci == 'true' }}
run: |
export CLN_PATH=${{ github.workspace }}/lightning
export COMPAT=${{ matrix.deprecated }}
export EXPERIMENTAL_FEATURES=${{ matrix.experimental }}
export SLOW_MACHINE=1
export TEST_DEBUG=1
export TRAVIS=1
export VALGRIND=0
pip3 install --upgrade pip
pip3 install --user -U virtualenv pip > /dev/null
if [[ "${{ github.event_name }}" == 'pull_request' ]]; then
plugin_dirs="${{ steps.set_plugin_dirs.outputs.plugin_dirs }}"
else
plugin_dirs=""
fi
# Run the tests: In the case of a 'pull_request' event only the plugins in `plugin_dirs`
# are going to be tested; otherwise ('push' event) we test all plugins.
update_badges=''
if [[ "${{ github.event_name }}" == 'push' && "${{ github.ref }}" == 'refs/heads/master' ]] || [[ "${{ github.event_name }}" == 'schedule' ]]
then
update_badges='--update-badges'
fi
if [[ -z "$plugin_dirs" ]]; then
# Test all plugins if no specific plugins were changed
python3 .ci/test.py main ${{ matrix.python-version }} $update_badges
else
python3 .ci/test.py main ${{ matrix.python-version }} $update_badges $(echo "$plugin_dirs")
fi
gather:
# A dummy task that depends on the full matrix of tests, and signals completion.
name: CI completion
runs-on: ubuntu-22.04
if: ${{ always() && github.event_name == 'push' }}
needs:
- build-and-test
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Complete
run: |
echo "Updating badges data for main workflow..."
python3 .ci/update_badges.py main 5 # We test for 5 distinct Python versions
echo "CI completed."