1
0
Fork 0
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:
ggabernet 2021-07-03 14:52:44 +02:00
parent 79fffbd77f
commit 926f3ba24f

View file

@ -10,6 +10,7 @@ import os
import sys import sys
import argparse import argparse
import re import re
import yaml
############################################ ############################################
############################################ ############################################
@ -51,13 +52,16 @@ def check_config(Config, Github):
### Ignore these profiles ### Ignore these profiles
ignore_me = ['czbiohub_aws'] ignore_me = ['czbiohub_aws']
tests.update(ignore_me) tests.update(ignore_me)
with open(Github, 'r') as ghfile: # parse yaml GitHub actions file
for line in ghfile: try:
if re.search('profile: ', line): with open(Github, 'r') as ghfile:
line = line.replace('\'','').replace('[','').replace(']','').replace('\n','') wf = yaml.safe_load(ghfile)
profiles = line.split(':')[1].split(',') profile_list = wf["profile_test"]["strategy"]["matrix"]["profile"]
for p in profiles: except Exception as e:
tests.add(p.strip()) 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 ###Check if sets are equal
if tests == config_profiles: if tests == config_profiles: