Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 35 additions & 9 deletions .github/workflows/check-self.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,47 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Build tester image

- name: Install Task
uses: arduino/setup-task@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5

- uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install Protoc
uses: arduino/setup-protoc@v3

- name: Install dependencies
run: task docker:install-dependencies

- name: Adjust PATH
run: |
sudo chmod a+rwx -R libs/gl-client-py
make docker-image
echo "/home/runner/.cargo/bin" >> $GITHUB_PATH
# Directory in which go-task deposits its binaries
echo $(pwd)/bin >> $GITHUB_PATH
echo "/tmp/bin/" >> $GITHUB_PATH

- name: Rust Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
/tmp/gltesting/cargo
/tmp/gltesting/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check Self
run : |
PYTEST_OPTS='-n 8' make docker-check-self

- name: Run python image
- name: Build binaries
run:
task ci-build

- name: Check Self
env:
GL_TESTING_IGNORE_HASH: 1
PYTEST_OPTS: -n 6
run : |
PYTEST_OPTS='-n 8' make docker-check-py
task clientpy:check
45 changes: 14 additions & 31 deletions .github/workflows/cln-version-manager-py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,26 @@ on:
merge_group:
push:
branches:
- master
- main

jobs:
source:
runs-on: ubuntu-20.04
steps:
# Check out the code
# We use a sparse check-out to ensure we only use the files we need
- name: Checkout code
uses: actions/checkout@v3

- name: Install Task
uses: arduino/setup-task@v2

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
sparse-checkout: |
libs/cln-version-manager
- name: Move files to toplevel
run: mv ./libs/cln-version-manager/** .
# Install python-3.8
- name: Install python
uses: actions/setup-python@v4
with:
python-version: 3.8
# Load the poetry installation if it still cached
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local # the path depends on the OS
key: poetry-0 # increment to reset cache
# Install poetry. By default the poetry-files venv is created
# in ~/.cache/virtualenvs
- name: Install poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
version: 1.8.2
- name: Install dependencies
run: poetry update && poetry install --no-interaction
- name: Run mypy
run: poetry run mypy
version: "latest"
enable-cache: true

- name: Build
run: task clnvm:build

- name: Run tests
run: poetry run pytest tests
run: task clnvm:check
21 changes: 10 additions & 11 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,19 @@ jobs:
with:
python-version: 3.9
architecture: x64
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
version: "latest"

- run: pip3 install poetry
- run: |
cd libs/gl-client-py
poetry build --format=sdist
- name: Build Source Distribution
run: uv build --package gl-client --sdist

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-source
path: libs/gl-client-py/dist/gl_client-*.tar.gz
path: dist/gl_client-*.tar.gz

linux:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -204,17 +206,14 @@ jobs:
sudo apt-get update -qq
sudo apt-get install python3-pip
sudo pip3 install -U \
poetry \
maturin \
twine \
keyring

uv

- name: Publish wheels to PyPI
env:
TWINE_USERNAME: __token__
run: |
cd libs/gl-client-py
twine upload \
uv tool run twine upload \
--skip-existing \
--non-interactive \
--verbose \
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ hsm_secret
site
.DS_Store
target
*.egg-info

# These files are auto generated and may contain sensible data that
# we do not want to check-in!
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,17 @@ gen: ${GENALL}

build-self: ensure-docker
cargo build --all
cd libs/gl-client-py; maturin develop
#mypy examples/python
uv sync --package gl-client --extra dev

check-all: check-rs check-self check-py check-testing-py

check-self: ensure-docker build-self
uv sync --package gl-testing
uv pip install libs/cln-version-manager
ls -lha .venv/bin
PYTHONPATH=/repo/libs/gl-testing \
pytest -vvv \
GL_TESTING_IGNORE_HASH=1 \
uv run python3 -m pytest -vvv -n 4 \
/repo/libs/gl-testing \
${PYTEST_OPTS}

Expand Down
50 changes: 50 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version: '3'

includes:
clnvm:
taskfile: "libs/cln-version-manager/.tasks.yml"
dir: "libs/cln-version-manager/"

clientpy:
taskfile: "libs/gl-client-py/.tasks.yml"
dir: "libs/gl-client-py/"

docker:
taskfile: "docker/.tasks.yml"
dir: "."

plugin:
taskfile: "libs/gl-plugin/.tasks.yml"
dir: "."

signerproxy:
taskfile: "libs/gl-signerproxy/.tasks.yml"
dir: "."

tasks:

ci-check:
deps:
- ci-build
cmds:
- task: clientpy:check
- task: clnvm:check

docker-ci-check:
cmds:
- >
docker buildx build \
--load \
--build-arg DOCKER_USER=$(whoami) \
--build-arg UID=$(id -u) \
--build-arg GID=$(id -g) \
--build-arg GL_TESTING_IGNORE_HASH=1 \
-t gltesting \
-f docker/gl-testing/Dockerfile \
.
- docker run -ti -v $(pwd):/repo gltesting task ci-check

ci-build:
cmds:
- task: signerproxy:build
- task: plugin:build
50 changes: 50 additions & 0 deletions docker/.tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version: "3"

tasks:
install-dependencies:
vars:
BINDIR: '{{.BINDIR | default "{{ .HOME }}/bin"}}'
deps:
- install-cfssl
- install-bitcoind

install-protoc:
dir: '/tmp'
env:
PROTOC_VERSION: 3.19.3
BINDIR: '{{.BINDIR | default "bin"}}'
cmds:
- wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip --quiet -O protoc.zip
- defer: rm protoc.zip
- unzip protoc.zip
- mkdir -p ${BINDIR}
- mv bin/protoc ${BINDIR}
- rm protoc.zip

install-cfssl:
env:
BASE: "https://github.com/cloudflare/cfssl/releases/download"
VERSION: 1.6.5
BINDIR: '{{.BINDIR | default "bin"}}'
dir: /tmp/
cmds:
- mkdir -p bin/
- wget -q ${BASE}/v${VERSION}/cfssl_${VERSION}_linux_amd64 -O ${BINDIR}/cfssl
- wget -q ${BASE}/v${VERSION}/cfssljson_${VERSION}_linux_amd64 -O ${BINDIR}/cfssljson
- chmod a+x ${BINDIR}/cfssljson
- chmod a+x ${BINDIR}/cfssl

install-bitcoind:
dir:
vars:
env:
BITCOIN_VERSION: 28.1
BINDIR: '{{.BINDIR | default "bin"}}'
cmds:
- mkdir -p {{ .HOME }}/bin
- wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz -O bitcoin.tar.gz
- defer: rm -rf bitcoin.tar.gz /tmp/bitcoin-${BITCOIN_VERSION}
- tar -xvzf bitcoin.tar.gz
- defer: rm -rf bitcoin-${BITCOIN_VERSION}
- mkdir -p ${BINDIR}
- mv bitcoin-${BITCOIN_VERSION}/bin/bitcoin* ${BINDIR}
Loading
Loading