Skip to content

Commit cc60047

Browse files
committed
ci: use download_lbug.sh
1 parent e993e8c commit cc60047

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
push:
88
branches: [main]
99

10+
permissions:
11+
actions: read
12+
contents: read
13+
1014
concurrency:
1115
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1216
cancel-in-progress: true
@@ -58,6 +62,54 @@ jobs:
5862
uv venv .venv
5963
uv pip install -e .[dev]
6064
65+
- name: Resolve compatible lbug artifact run
66+
working-directory: ladybug
67+
env:
68+
GITHUB_TOKEN: ${{ github.token }}
69+
run: |
70+
SHA="$(git rev-parse HEAD)"
71+
API_URL="https://api.github.com/repos/LadybugDB/ladybug/actions/workflows/build-and-deploy.yml/runs"
72+
AUTH_HEADER="Authorization: Bearer $GITHUB_TOKEN"
73+
ACCEPT_HEADER="Accept: application/vnd.github+json"
74+
VERSION_HEADER="X-GitHub-Api-Version: 2022-11-28"
75+
76+
RUN_ID="$(
77+
curl -fsSL \
78+
-H "$AUTH_HEADER" \
79+
-H "$ACCEPT_HEADER" \
80+
-H "$VERSION_HEADER" \
81+
"$API_URL?head_sha=$SHA&status=success&per_page=1" \
82+
| python -c 'import json,sys; data=json.load(sys.stdin); runs=data.get("workflow_runs") or []; print(runs[0]["id"] if runs else "")'
83+
)"
84+
85+
if [ -z "$RUN_ID" ]; then
86+
RUN_ID="$(
87+
curl -fsSL \
88+
-H "$AUTH_HEADER" \
89+
-H "$ACCEPT_HEADER" \
90+
-H "$VERSION_HEADER" \
91+
"$API_URL?branch=main&status=success&per_page=1" \
92+
| python -c 'import json,sys; data=json.load(sys.stdin); runs=data.get("workflow_runs") or []; print(runs[0]["id"] if runs else "")'
93+
)"
94+
fi
95+
96+
if [ -z "$RUN_ID" ]; then
97+
echo "Could not find a successful LadybugDB/ladybug build-and-deploy run." >&2
98+
exit 1
99+
fi
100+
101+
echo "Using Ladybug build-and-deploy RUN_ID=$RUN_ID for SHA=$SHA"
102+
echo "LBUG_BUILD_RUN_ID=$RUN_ID" >> "$GITHUB_ENV"
103+
104+
- name: Download shared lbug library
105+
working-directory: ladybug/tools/python_api
106+
env:
107+
GH_TOKEN: ${{ github.token }}
108+
run: |
109+
gh --version
110+
LBUG_PRECOMPILED_RUN_ID="$LBUG_BUILD_RUN_ID" LBUG_LIB_KIND=shared bash scripts/download_lbug.sh .cache/lbug-capi.env
111+
cat .cache/lbug-capi.env >> "$GITHUB_ENV"
112+
61113
- name: Check formatting (black)
62114
working-directory: ladybug/tools/python_api
63115
run: |

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dev = [
2626
"setuptools~=80.9",
2727
"ruff==0.11.12",
2828
"mypy==1.16.0",
29-
"torch>=2.5.0",
29+
"torch>=2.5.0,<2.6.0",
3030
"torch-geometric>=2.5.0",
3131
]
3232

0 commit comments

Comments
 (0)