-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathTaskfile.yml
More file actions
125 lines (109 loc) · 3.4 KB
/
Taskfile.yml
File metadata and controls
125 lines (109 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
version: "3"
includes:
build:
taskfile: "build/.tasks.yml"
dir: "."
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/"
testing:
taskfile: "libs/gl-testing/.tasks.yml"
dir: "libs/gl-testing/"
docker:
taskfile: "docker/.tasks.yml"
dir: "."
plugin:
taskfile: "libs/gl-plugin/.tasks.yml"
dir: "."
signerproxy:
taskfile: "libs/gl-signerproxy/.tasks.yml"
dir: "."
sdk:
taskfile: "libs/gl-sdk/.tasks.yml"
dir: "libs/gl-sdk/"
tasks:
check-changelogs:
desc: "Validate all changelogs follow Keep a Changelog format"
cmds:
- |
status=0
for cl in libs/gl-client/CHANGELOG.md libs/gl-sdk/CHANGELOG.md libs/gl-plugin/CHANGELOG.md libs/gl-client-py/CHANGELOG.md libs/gl-testing/CHANGELOG.md; do
if [ -f "$cl" ]; then
echo "Checking $cl..."
(cd "$(dirname "$cl")" && uv run --with python-kacl kacl-cli verify) || status=1
fi
done
exit $status
ci-check:
deps:
- ci-build
cmds:
- task: check-changelogs
- task: sdk:test
- task: clientpy:check
- task: testing:check
- task: clnvm:check
docker-ci-build:
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 \
--platform=linux/amd64 \
-t gltesting \
-f docker/gl-testing/Dockerfile \
.
docker-ci-check:
deps:
- docker-ci-build
cmds:
- docker run --rm -ti -v $(pwd):/repo gltesting task ci-check
ci-build:
cmds:
- task: signerproxy:build
- task: plugin:build
act:
desc: "Run GitHub Actions locally via act in a clean clone"
vars:
ACT_ARGS: '{{.CLI_ARGS}}'
cmds:
- |
set -e
# Create a stash commit capturing the full working state (staged + unstaged + untracked)
STASH_HASH=$(git stash create --include-untracked)
if [ -z "$STASH_HASH" ]; then
STASH_HASH=$(git rev-parse HEAD)
fi
BRANCH=$(git branch --show-current 2>/dev/null || echo "act-snapshot")
: "${BRANCH:=act-snapshot}"
echo "Snapshot: $STASH_HASH (branch: $BRANCH)"
# Clone into a temp directory (shared objects via --reference for speed)
CLONE_DIR=$(mktemp -d /tmp/act-XXXXXX)
trap "echo 'Cleaning up $CLONE_DIR'; rm -rf '$CLONE_DIR'" EXIT
echo "Cloning to $CLONE_DIR"
git clone --reference "$(git rev-parse --git-dir)" "$(git rev-parse --show-toplevel)" "$CLONE_DIR"
cd "$CLONE_DIR"
git checkout -b "${BRANCH}-act" "$STASH_HASH"
ACT_ARGS="{{.ACT_ARGS}}"
if [ -n "$ACT_ARGS" ]; then
echo "Running: act $ACT_ARGS"
act $ACT_ARGS --platform ubuntu-latest=catthehacker/ubuntu:act-latest
else
# Run each workflow file separately
for wf in .github/workflows/*.yml; do
echo ""
echo "========== $(basename $wf) =========="
act -W "$wf" --platform ubuntu-latest=catthehacker/ubuntu:act-latest || echo "⚠ $(basename $wf) failed"
done
fi
clean:
dir: "."
cmds:
- cargo clean
- rm -rf .venv