mirror of
https://github.com/MillironX/nf-configs.git
synced 2024-11-21 16:16:04 +00:00
update checker script
This commit is contained in:
parent
79fffbd77f
commit
926f3ba24f
1 changed files with 11 additions and 7 deletions
|
@ -10,6 +10,7 @@ import os
|
|||
import sys
|
||||
import argparse
|
||||
import re
|
||||
import yaml
|
||||
|
||||
############################################
|
||||
############################################
|
||||
|
@ -51,13 +52,16 @@ def check_config(Config, Github):
|
|||
### Ignore these profiles
|
||||
ignore_me = ['czbiohub_aws']
|
||||
tests.update(ignore_me)
|
||||
# parse yaml GitHub actions file
|
||||
try:
|
||||
with open(Github, 'r') as ghfile:
|
||||
for line in ghfile:
|
||||
if re.search('profile: ', line):
|
||||
line = line.replace('\'','').replace('[','').replace(']','').replace('\n','')
|
||||
profiles = line.split(':')[1].split(',')
|
||||
for p in profiles:
|
||||
tests.add(p.strip())
|
||||
wf = yaml.safe_load(ghfile)
|
||||
profile_list = wf["profile_test"]["strategy"]["matrix"]["profile"]
|
||||
except Exception as e:
|
||||
return {"failed": ["Could not parse yaml file: {}, {}".format(Github, e)]}
|
||||
# Add profiles to test
|
||||
for profile in profile_list:
|
||||
tests.add(profile.strip())
|
||||
|
||||
###Check if sets are equal
|
||||
if tests == config_profiles:
|
||||
|
|
Loading…
Reference in a new issue