1
0
Fork 0
mirror of https://github.com/MillironX/nf-configs.git synced 2024-11-22 00:26:03 +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)
# parse yaml GitHub actions file
try:
with open(Github, 'r') as ghfile: with open(Github, 'r') as ghfile:
for line in ghfile: wf = yaml.safe_load(ghfile)
if re.search('profile: ', line): profile_list = wf["profile_test"]["strategy"]["matrix"]["profile"]
line = line.replace('\'','').replace('[','').replace(']','').replace('\n','') except Exception as e:
profiles = line.split(':')[1].split(',') return {"failed": ["Could not parse yaml file: {}, {}".format(Github, e)]}
for p in profiles: # Add profiles to test
tests.add(p.strip()) 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: