Skip to content

Commit

Permalink
CI: add workflows and badges
Browse files Browse the repository at this point in the history
  • Loading branch information
daywalker90 committed Mar 29, 2024
1 parent c73633a commit efb6b96
Show file tree
Hide file tree
Showing 9 changed files with 201 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions .github/workflows/latest_v23.08.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions .github/workflows/latest_v23.11.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions .github/workflows/latest_v24.02.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions .github/workflows/main_v23.08.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions .github/workflows/main_v23.11.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions .github/workflows/main_v24.02.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
Empty file modified tests/setup.sh
100644 → 100755
Empty file.

0 comments on commit efb6b96

Please sign in to comment.