Skip to content

Commit

Permalink
clnvm(ci): Move CI operations to Taskfile
Browse files Browse the repository at this point in the history
This should eventually allow us to replay the CI locally without
talking to GH. Should shorten the CI debugging cycle considerably.
  • Loading branch information
cdecker committed Jan 25, 2025
1 parent 2853a2a commit db94f91
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 36 deletions.
47 changes: 16 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,28 @@ 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
7 changes: 3 additions & 4 deletions libs/cln-version-manager/clnvm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ def configure_logging() -> None:
logging.config.fileConfig(fname)

# Handle the optional import and provide a nice error message if it fails
_click = importlib.util.find_spec("click")
if _click is None:
try:
import click
except Exception:
print("To use clnvm the `cli` feature must be installed")
print("You can install the feature using")
print("> pip install gltesting[cli]")
sys.exit(1)

import click


@click.group()
@click.option("--verbose", is_flag=True)
Expand Down
7 changes: 6 additions & 1 deletion libs/cln-version-manager/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ clnvm = "clnvm.cli:run"
requires = ["hatchling"]
build-backend = "hatchling.build"

[dependency-groups]
dev = [
"types-requests>=2.31.0.6",
]

[tool.hatch.build]
include = [
"clnvm",
]
]

0 comments on commit db94f91

Please sign in to comment.