5555 env_name_serve : ${{ steps.config.outputs.env_name_serve }}
5656 env_name_rl : ${{ steps.config.outputs.env_name_rl }}
5757 steps :
58- - name : Checkout code
58+ - name : Checkout code (attempt 1)
59+ id : checkout_attempt_1
5960 uses : actions/checkout@v4
61+ continue-on-error : true
6062 with :
6163 repository : ${{ github.event.pull_request.head.repo.full_name || github.repository }}
6264 ref : ${{ github.event.pull_request.head.ref || github.ref }}
@@ -71,28 +73,42 @@ jobs:
7173 submodules : false
7274 set-safe-directory : true
7375
74- - name : Cache source code
75- id : cache-source
76- uses : actions/cache@v4
76+ - name : Checkout code (attempt 2)
77+ if : steps.checkout_attempt_1.outcome == 'failure'
78+ id : checkout_attempt_2
79+ uses : actions/checkout@v4
80+ continue-on-error : true
7781 with :
78- path : .
79- key : source-code-${{ github.sha }}
80-
81- - name : Create source code tarball for distribution
82- run : |
83- tar -czf /tmp/flagscale-source.tar.gz \
84- --exclude='.git' \
85- --exclude='*.pyc' \
86- --exclude='__pycache__' \
87- .
82+ repository : ${{ github.event.pull_request.head.repo.full_name || github.repository }}
83+ ref : ${{ github.event.pull_request.head.ref || github.ref }}
84+ ssh-strict : true
85+ ssh-user : git
86+ persist-credentials : false
87+ clean : true
88+ sparse-checkout-cone-mode : true
89+ fetch-tags : false
90+ show-progress : true
91+ lfs : false
92+ submodules : false
93+ set-safe-directory : true
8894
89- - name : Upload source code artifact
90- uses : actions/upload-artifact@v4
95+ - name : Checkout code (attempt 3)
96+ if : steps.checkout_attempt_2.outcome == 'failure'
97+ id : checkout_attempt_3
98+ uses : actions/checkout@v4
9199 with :
92- name : flagscale-source-${{ github.sha }}
93- path : /tmp/flagscale-source.tar.gz
94- retention-days : 1
95- compression-level : 0
100+ repository : ${{ github.event.pull_request.head.repo.full_name || github.repository }}
101+ ref : ${{ github.event.pull_request.head.ref || github.ref }}
102+ ssh-strict : true
103+ ssh-user : git
104+ persist-credentials : false
105+ clean : true
106+ sparse-checkout-cone-mode : true
107+ fetch-tags : false
108+ show-progress : true
109+ lfs : false
110+ submodules : false
111+ set-safe-directory : true
96112
97113 - name : Load platform configuration
98114 id : config
@@ -149,7 +165,6 @@ jobs:
149165 runs_on : ${{ needs.checkout_and_config.outputs.runs_on }}
150166 container_volumes : ${{ needs.checkout_and_config.outputs.container_volumes }}
151167 container_options : ${{ needs.checkout_and_config.outputs.container_options }}
152- source_artifact : flagscale-source-${{ github.sha }}
153168 pkg_mgr : ${{ needs.checkout_and_config.outputs.pkg_mgr }}
154169 env_name : ${{ needs.checkout_and_config.outputs.env_name_train }}
155170 env_path : ${{ needs.checkout_and_config.outputs.env_path }}
@@ -172,7 +187,6 @@ jobs:
172187 runs_on : ${{ needs.checkout_and_config.outputs.runs_on }}
173188 container_volumes : ${{ needs.checkout_and_config.outputs.container_volumes }}
174189 container_options : ${{ needs.checkout_and_config.outputs.container_options }}
175- source_artifact : flagscale-source-${{ github.sha }}
176190 pkg_mgr : ${{ needs.checkout_and_config.outputs.pkg_mgr }}
177191 env_name : ${{ needs.checkout_and_config.outputs.env_name_train }}
178192 env_path : ${{ needs.checkout_and_config.outputs.env_path }}
@@ -191,7 +205,6 @@ jobs:
191205 runs_on : ${{ needs.checkout_and_config.outputs.runs_on }}
192206 container_volumes : ${{ needs.checkout_and_config.outputs.container_volumes }}
193207 container_options : ${{ needs.checkout_and_config.outputs.container_options }}
194- source_artifact : flagscale-source-${{ github.sha }}
195208 pkg_mgr : ${{ needs.checkout_and_config.outputs.pkg_mgr }}
196209 env_name : ${{ needs.checkout_and_config.outputs.env_name_train }}
197210 env_path : ${{ needs.checkout_and_config.outputs.env_path }}
@@ -210,7 +223,6 @@ jobs:
210223 runs_on : ${{ needs.checkout_and_config.outputs.runs_on }}
211224 container_volumes : ${{ needs.checkout_and_config.outputs.container_volumes }}
212225 container_options : ${{ needs.checkout_and_config.outputs.container_options }}
213- source_artifact : flagscale-source-${{ github.sha }}
214226 pkg_mgr : ${{ needs.checkout_and_config.outputs.pkg_mgr }}
215227 env_name : ${{ needs.checkout_and_config.outputs.env_name_train }}
216228 env_path : ${{ needs.checkout_and_config.outputs.env_path }}
@@ -229,7 +241,6 @@ jobs:
229241 runs_on : ${{ needs.checkout_and_config.outputs.runs_on }}
230242 container_volumes : ${{ needs.checkout_and_config.outputs.container_volumes }}
231243 container_options : ${{ needs.checkout_and_config.outputs.container_options }}
232- source_artifact : flagscale-source-${{ github.sha }}
233244 pkg_mgr : ${{ needs.checkout_and_config.outputs.pkg_mgr }}
234245 env_name : ${{ needs.checkout_and_config.outputs.env_name_inference }}
235246 env_path : ${{ needs.checkout_and_config.outputs.env_path }}
@@ -248,7 +259,6 @@ jobs:
248259 runs_on : ${{ needs.checkout_and_config.outputs.runs_on }}
249260 container_volumes : ${{ needs.checkout_and_config.outputs.container_volumes }}
250261 container_options : ${{ needs.checkout_and_config.outputs.container_options }}
251- source_artifact : flagscale-source-${{ github.sha }}
252262 pkg_mgr : ${{ needs.checkout_and_config.outputs.pkg_mgr }}
253263 env_name : ${{ needs.checkout_and_config.outputs.env_name_serve }}
254264 env_path : ${{ needs.checkout_and_config.outputs.env_path }}
@@ -267,7 +277,6 @@ jobs:
267277 # runs_on: ${{ needs.checkout_and_config.outputs.runs_on }}
268278 # container_volumes: ${{ needs.checkout_and_config.outputs.container_volumes }}
269279 # container_options: ${{ needs.checkout_and_config.outputs.container_options }}
270- # source_artifact: flagscale-source-${{ github.sha }}
271280 # pkg_mgr: ${{ needs.checkout_and_config.outputs.pkg_mgr }}
272281 # env_name: ${{ needs.checkout_and_config.outputs.env_name_rl }}
273282 # env_path: ${{ needs.checkout_and_config.outputs.env_path }}
@@ -286,7 +295,6 @@ jobs:
286295 runs_on : ${{ needs.checkout_and_config.outputs.runs_on }}
287296 container_volumes : ${{ needs.checkout_and_config.outputs.container_volumes }}
288297 container_options : ${{ needs.checkout_and_config.outputs.container_options }}
289- source_artifact : flagscale-source-${{ github.sha }}
290298 pkg_mgr : ${{ needs.checkout_and_config.outputs.pkg_mgr }}
291299 env_name : ${{ needs.checkout_and_config.outputs.env_name_train }}
292300 env_path : ${{ needs.checkout_and_config.outputs.env_path }}
0 commit comments