@@ -296,10 +296,27 @@ def setup_idf_environ():
296
296
# this removes any IDF environment variable that may exist if the user
297
297
# has the ESP-IDF installed
298
298
env = {k : v for k , v in os .environ .items () if not k .startswith ('IDF' )}
299
- env ['IDF_PATH' ] = os .path .abspath (idf_path )
300
-
301
299
py_path = os .path .split (sys .executable )[0 ]
302
300
301
+ if 'GITHUB_RUN_ID' in env :
302
+ if sys .platform .startswith ('win' ):
303
+ env_cmds = [
304
+ ['echo' , f"{ py_path } " , '|' , 'Out-File' , '-Append' ,
305
+ '-FilePath' , '$env:GITHUB_PATH' , '-Encoding' , 'utf8' ],
306
+ ['echo' , f"{ os .path .abspath (idf_path )} " , '|' , 'Out-File' , '-Append' ,
307
+ '-FilePath' , '$env:GITHUB_PATH' , '-Encoding' , 'utf8' ]
308
+ ]
309
+ else :
310
+ env_cmds = [
311
+ 'echo "C:/Program Files (x86)/Etc" >> $GITHUB_PATH'
312
+ ['echo' , f"{ py_path } " , '>>' , '$GITHUB_PATH' ],
313
+ ['echo' , f"{ os .path .abspath (idf_path )} " , '>>' , '$GITHUB_PATH' ]
314
+ ]
315
+
316
+ spawn (env_cmds , env = env , out_to_screen = False )
317
+
318
+ env ['IDF_PATH' ] = os .path .abspath (idf_path )
319
+
303
320
if 'PATH' in env :
304
321
env ['PATH' ] = py_path + os .pathsep + env ['PATH' ]
305
322
elif 'path' in env :
0 commit comments