mirror of
https://github.com/talaia-labs/rust-teos.git
synced 2026-08-14 12:43:21 +02:00
- Correct YAML indentation - Fix Poetry installation (no --user, avoids not found errors) - Remove unnecessary steps and sudo usage - Modularize CLN cache jobs - Run `poetry run make` concurrently to speed up build
96 lines
3 KiB
YAML
96 lines
3 KiB
YAML
name: CI tests for CLN watchtower-plugin
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
|
|
env:
|
|
bitcoind_version: "27.0"
|
|
cln_version: "24.11.1"
|
|
|
|
jobs:
|
|
check-cln-cache:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
cache-hit: ${{ steps.cache.outputs.cache-hit }}
|
|
steps:
|
|
- name: Check CLN cache
|
|
id: cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: lightning
|
|
key: ${{ runner.os }}-build-cache-cln-dev-v${{ env.cln_version }}
|
|
|
|
cache-cln:
|
|
runs-on: ubuntu-latest
|
|
needs: check-cln-cache
|
|
if: ${{ needs.check-cln-cache.outputs.cache-hit != 'true' }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.9'
|
|
check-latest: true
|
|
- uses: arduino/setup-protoc@v3
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Create CLN cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: lightning
|
|
key: ${{ runner.os }}-build-cache-cln-dev-v${{ env.cln_version }}
|
|
- name: Compile CLN
|
|
env:
|
|
PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
|
|
run: |
|
|
sudo apt-get update && sudo apt-get install -y gettext
|
|
git clone https://github.com/ElementsProject/lightning.git && cd lightning && git checkout v${{ env.cln_version }}
|
|
pip install --user poetry && poetry install
|
|
./configure && poetry run make -j 8
|
|
|
|
cln-plugin:
|
|
needs: cache-cln
|
|
if: ${{ always() }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.9'
|
|
check-latest: true
|
|
- uses: arduino/setup-protoc@v3
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: stable
|
|
components: rustfmt, clippy
|
|
- name: Install bitcoind
|
|
run: |
|
|
wget https://bitcoincore.org/bin/bitcoin-core-${{ env.bitcoind_version }}/bitcoin-${{ env.bitcoind_version }}-x86_64-linux-gnu.tar.gz
|
|
tar -xzf bitcoin-${{ env.bitcoind_version }}-x86_64-linux-gnu.tar.gz
|
|
ln -s $(pwd)/bitcoin-${{ env.bitcoind_version }}/bin/bitcoin* /usr/local/bin
|
|
- name: Load CLN cache
|
|
id: cache-cln
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: lightning
|
|
key: ${{ runner.os }}-build-cache-cln-dev-v${{ env.cln_version }}
|
|
- name: Link CLN
|
|
run: |
|
|
cd lightning && sudo PATH=$PATH make install
|
|
- name: Install teos and the plugin
|
|
run: |
|
|
cargo install --locked --path teos
|
|
cargo install --locked --path watchtower-plugin
|
|
- name: Add test dependencies
|
|
run: |
|
|
cd watchtower-plugin/tests
|
|
pip install --user poetry && poetry install --no-root
|
|
- name: Run tests
|
|
run: |
|
|
cd watchtower-plugin/tests
|
|
VALGRIND=0 SLOW_MACHINE=1 poetry run pytest test.py --log-cli-level=INFO -s
|