@@ -14,9 +14,20 @@ concurrency:
1414 cancel-in-progress : true
1515
1616jobs :
17+ handle-syncwith :
18+ if : github.event_name == 'pull_request'
19+ name : Call Reusable SyncWith Handler
20+ uses : NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1
21+ with :
22+ ci-cd-ref : ' v1'
23+ secrets : inherit
24+
1725 build-linux :
1826 runs-on : [ self-hosted, Linux, amd64 ]
1927
28+ needs :
29+ - handle-syncwith
30+
2031 env :
2132 CONTAINER_TMP : /opt/
2233 HOST_TMP : /home/runner/work/_temp/
@@ -49,21 +60,37 @@ jobs:
4960 cmake --version
5061
5162 - name : Checkout sources
63+ # We need full history, because during CMake config stage we are finding the nearest tag
5264 uses : actions/checkout@v3
5365 with :
54- submodules : ' recursive'
5566 fetch-depth : 0
56-
57- - name : Clean index.lock files if checkout step was cancelled or failed
58- if : cancelled() || failure()
59- run : |
60- find .git -name 'index.lock' -exec rm -v {} \;
67+ submodules : false
6168
6269 # Workaround: https://github.com/actions/checkout/issues/1169
6370 - name : Mark directory as safe
6471 run : |
6572 git config --system --add safe.directory $PWD
6673
74+ - name : Checkout submodules
75+ run : |
76+ git submodule update --init --recursive --depth=1
77+
78+ - name : Checkout modules to specified refs
79+ if : needs.handle-syncwith.outputs.prs-refs != ''
80+ uses : NilFoundation/ci-cd/actions/recursive-checkout@v1
81+ # TODO: figure out the mapping of volumes and use variable here, not hardcoded path
82+ with :
83+ paths : |
84+ /__w/zkLLVM/zkLLVM/**
85+ !/__w/zkLLVM/zkLLVM/
86+ !/__w/zkLLVM/zkLLVM/**/.git/**
87+ refs : ${{ needs.handle-syncwith.outputs.prs-refs }}
88+
89+ - name : Clean index.lock files if checkout step was cancelled or failed
90+ if : cancelled() || failure()
91+ run : |
92+ find .git -name 'index.lock' -exec rm -v {} \;
93+
6794 - name : Install boost
68956996 id : install-boost
0 commit comments