File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -138,9 +138,20 @@ jobs:
138138 with :
139139 lfs : true
140140
141+ - name : Login to GitHub Container Registry
142+ uses : docker/login-action@v3
143+ with :
144+ registry : ghcr.io
145+ username : ${{ github.actor }}
146+ password : ${{ secrets.GITHUB_TOKEN }}
147+
148+ - name : Pre-pull Alloy image cache
149+ run : |
150+ docker pull ghcr.io/graphistry/alloy6:6.2.0 || true
151+
141152 - name : Run Alloy checks (full scopes)
142153 run : |
143- FULL=1 bash alloy/check_fbf_where.sh
154+ ALLOY_PUSH=1 FULL=1 bash alloy/check_fbf_where.sh
144155
145156 test-minimal-python :
146157 needs : [changes, python-lint-types]
Original file line number Diff line number Diff line change @@ -3,14 +3,41 @@ set -euo pipefail
33
44HERE=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
55ALS=" /work/gfql_fbf_where.als"
6- IMAGE=" local/alloy6:latest"
6+ IMAGE=" ${ALLOY_IMAGE:- ghcr.io/ graphistry/ alloy6: 6.2.0} "
7+ LOCAL_FALLBACK_IMAGE=" ${ALLOY_FALLBACK_IMAGE:- local/ alloy6: latest} "
78FULL=${FULL:- 0}
89MULTI=${MULTI:- 0}
10+ PUSH=${ALLOY_PUSH:- 0}
911
10- # Build image if missing
11- if ! docker image inspect " $IMAGE " > /dev/null 2>&1 ; then
12- docker build -t " $IMAGE " " $HERE "
13- fi
12+ # Resolve image: pull ghcr if possible, otherwise build local; optionally push built image to ghcr for caching
13+ resolve_image () {
14+ local img=" $IMAGE "
15+ if docker image inspect " $img " > /dev/null 2>&1 ; then
16+ IMAGE=" $img "
17+ return
18+ fi
19+
20+ if docker pull " $img " > /dev/null 2>&1 ; then
21+ IMAGE=" $img "
22+ return
23+ fi
24+
25+ # Fall back to local build
26+ if ! docker image inspect " $LOCAL_FALLBACK_IMAGE " > /dev/null 2>&1 ; then
27+ docker build -t " $LOCAL_FALLBACK_IMAGE " " $HERE "
28+ fi
29+
30+ # Optionally publish to ghcr for future pulls
31+ if [ " $PUSH " = " 1" ]; then
32+ docker tag " $LOCAL_FALLBACK_IMAGE " " $img "
33+ docker push " $img " || true
34+ IMAGE=" $img "
35+ else
36+ IMAGE=" $LOCAL_FALLBACK_IMAGE "
37+ fi
38+ }
39+
40+ resolve_image
1441
1542if [ " $FULL " = " 1" ]; then
1643 docker run --rm -v " $HERE " :/work " $IMAGE " exec -c SpecNoWhereEqAlgoNoWhere -o - " $ALS "
You can’t perform that action at this time.
0 commit comments