diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5cf083f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,92 @@ +name: CI + +# Cancel duplicate jobs +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +on: + workflow_call: + inputs: + cln-version: + required: true + type: string + pyln-version: + required: true + type: string + tagged-release: + required: true + type: boolean + +jobs: + build: + name: Test CLN=${{ inputs.cln-version }} PY=${{ matrix.python-version }}, BCD=${{ matrix.bitcoind-version }}, EXP=${{ matrix.experimental }}, DEP=${{ matrix.deprecated }} + strategy: + fail-fast: false + matrix: + bitcoind-version: ["26.0"] + experimental: [1] + deprecated: [0] + python-version: ["3.8", "3.12"] + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download Bitcoin ${{ matrix.bitcoind-version }} & install binaries + 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 ${{ inputs.cln-version }} & install binaries + run: | + url=$(curl -s https://api.github.com/repos/ElementsProject/lightning/releases/tags/${{ inputs.cln-version }} \ + | 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: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Python dependencies + run: | + pip3 install --user "pyln-proto<=${{ inputs.pyln-version }}" "pyln-client<=${{ inputs.pyln-version }}" "pyln-testing<=${{ inputs.pyln-version }}" + pip3 install --user pytest-xdist + + - name: Set up Rust + if: ${{ inputs.tagged-release == false}} + uses: dtolnay/rust-toolchain@stable + + - name: Set up protoc + if: ${{ inputs.tagged-release == false}} + uses: arduino/setup-protoc@v3 + + - name: Get plugin binary + run: | + if ${{ inputs.tagged-release }}; then + cd tests + ./setup.sh + cd .. + else + cargo build + fi + + - name: Run tests + 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 + pytest -n=5 tests/test_*.py \ No newline at end of file diff --git a/.github/workflows/latest_v23.08.yml b/.github/workflows/latest_v23.08.yml new file mode 100644 index 0000000..0e69824 --- /dev/null +++ b/.github/workflows/latest_v23.08.yml @@ -0,0 +1,14 @@ +name: latest release on CLN v23.08.1 + +on: + release: + types: [published, edited] + workflow_dispatch: + +jobs: + call-ci: + uses: ./.github/workflows/ci.yml + with: + cln-version: "v23.08.1" + pyln-version: "23.08" + tagged-release: true \ No newline at end of file diff --git a/.github/workflows/latest_v23.11.yml b/.github/workflows/latest_v23.11.yml new file mode 100644 index 0000000..4a6dfd3 --- /dev/null +++ b/.github/workflows/latest_v23.11.yml @@ -0,0 +1,14 @@ +name: latest release on CLN v23.11.2 + +on: + release: + types: [published, edited] + workflow_dispatch: + +jobs: + call-ci: + uses: ./.github/workflows/ci.yml + with: + cln-version: "v23.11.2" + pyln-version: "23.11" + tagged-release: true \ No newline at end of file diff --git a/.github/workflows/latest_v24.02.yml b/.github/workflows/latest_v24.02.yml new file mode 100644 index 0000000..2eca78e --- /dev/null +++ b/.github/workflows/latest_v24.02.yml @@ -0,0 +1,14 @@ +name: latest release on CLN v24.02.1 + +on: + release: + types: [published, edited] + workflow_dispatch: + +jobs: + call-ci: + uses: ./.github/workflows/ci.yml + with: + cln-version: "v24.02.1" + pyln-version: "24.02" + tagged-release: true \ No newline at end of file diff --git a/.github/workflows/main_v23.08.yml b/.github/workflows/main_v23.08.yml new file mode 100644 index 0000000..11a742e --- /dev/null +++ b/.github/workflows/main_v23.08.yml @@ -0,0 +1,21 @@ +name: main on CLN v23.08.1 + +on: + push: + branches: + - main + paths-ignore: + - 'README.md' + - 'LICENSE' + - '.gitignore' + - 'coffee.yml' + pull_request: + workflow_dispatch: + +jobs: + call-ci: + uses: ./.github/workflows/ci.yml + with: + cln-version: "v23.08.1" + pyln-version: "23.08" + tagged-release: false \ No newline at end of file diff --git a/.github/workflows/main_v23.11.yml b/.github/workflows/main_v23.11.yml new file mode 100644 index 0000000..419e2be --- /dev/null +++ b/.github/workflows/main_v23.11.yml @@ -0,0 +1,21 @@ +name: main on CLN v23.11.2 + +on: + push: + branches: + - main + paths-ignore: + - 'README.md' + - 'LICENSE' + - '.gitignore' + - 'coffee.yml' + pull_request: + workflow_dispatch: + +jobs: + call-ci: + uses: ./.github/workflows/ci.yml + with: + cln-version: "v23.11.2" + pyln-version: "23.11" + tagged-release: false \ No newline at end of file diff --git a/.github/workflows/main_v24.02.yml b/.github/workflows/main_v24.02.yml new file mode 100644 index 0000000..b064f41 --- /dev/null +++ b/.github/workflows/main_v24.02.yml @@ -0,0 +1,21 @@ +name: main on CLN v24.02.1 + +on: + push: + branches: + - main + paths-ignore: + - 'README.md' + - 'LICENSE' + - '.gitignore' + - 'coffee.yml' + pull_request: + workflow_dispatch: + +jobs: + call-ci: + uses: ./.github/workflows/ci.yml + with: + cln-version: "v24.02.1" + pyln-version: "24.02" + tagged-release: false \ No newline at end of file diff --git a/README.md b/README.md index f80864a..f7a6028 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +[![latest release on CLN v24.02.1](https://github.com/daywalker90/summars/actions/workflows/latest_v24.02.yml/badge.svg?branch=main)](https://github.com/daywalker90/summars/actions/workflows/latest_v24.02.yml) [![latest release on CLN v23.11.2](https://github.com/daywalker90/summars/actions/workflows/latest_v23.11.yml/badge.svg?branch=main)](https://github.com/daywalker90/summars/actions/workflows/latest_v23.11.yml) [![latest release on CLN v23.08.1](https://github.com/daywalker90/summars/actions/workflows/latest_v23.08.yml/badge.svg?branch=main)](https://github.com/daywalker90/summars/actions/workflows/latest_v23.08.yml) + +[![main on CLN v24.02.1](https://github.com/daywalker90/summars/actions/workflows/main_v24.02.yml/badge.svg?event=push)](https://github.com/daywalker90/summars/actions/workflows/main_v24.02.yml) [![main on CLN v23.11.2](https://github.com/daywalker90/summars/actions/workflows/main_v23.11.yml/badge.svg?event=push)](https://github.com/daywalker90/summars/actions/workflows/main_v23.11.yml) [![main on CLN v23.08.1](https://github.com/daywalker90/summars/actions/workflows/main_v23.08.yml/badge.svg?event=push)](https://github.com/daywalker90/summars/actions/workflows/main_v23.08.yml) + # summars A core lightning plugin to show a summary of your channels and optionally recent forwards, payments and/or paid invoices. diff --git a/tests/setup.sh b/tests/setup.sh old mode 100644 new mode 100755