|
|
@@ -7,36 +7,31 @@ import os
|
|
|
|
|
|
import yaml
|
|
|
|
|
|
-try:
|
|
|
- from yaml import CLoader as Loader
|
|
|
-except ImportError:
|
|
|
- from yaml import Loader as Loader
|
|
|
-
|
|
|
IDF_PATH = os.getenv('IDF_PATH')
|
|
|
if not IDF_PATH:
|
|
|
print('Please set IDF_PATH before running this script')
|
|
|
raise SystemExit(-1)
|
|
|
|
|
|
-GITLAB_CONFIG_FILE = os.path.join(os.getenv('IDF_PATH'), '.gitlab-ci.yml')
|
|
|
+GITLAB_CONFIG_FILE = os.path.join(IDF_PATH, '.gitlab-ci.yml')
|
|
|
|
|
|
|
|
|
def check_artifacts_expire_time():
|
|
|
with open(GITLAB_CONFIG_FILE, 'r') as f:
|
|
|
- config = yaml.load(f, Loader=Loader)
|
|
|
+ config = yaml.load(f, Loader=yaml.FullLoader)
|
|
|
|
|
|
- errors = []
|
|
|
+ # load files listed in `include`
|
|
|
+ if 'include' in config:
|
|
|
+ for _file in config['include']:
|
|
|
+ with open(os.path.join(IDF_PATH, _file)) as f:
|
|
|
+ config.update(yaml.load(f, Loader=yaml.FullLoader))
|
|
|
|
|
|
print('expire time for jobs:')
|
|
|
+ errors = []
|
|
|
|
|
|
job_names = list(config.keys())
|
|
|
job_names.sort()
|
|
|
|
|
|
for job_name in job_names:
|
|
|
-
|
|
|
- if job_name.startswith('.'):
|
|
|
- # skip ignored jobs
|
|
|
- continue
|
|
|
-
|
|
|
try:
|
|
|
if 'expire_in' not in config[job_name]['artifacts']:
|
|
|
errors.append(job_name)
|