Skip to content

Commit

Permalink
check for actionsification
Browse files Browse the repository at this point in the history
  • Loading branch information
ladyada committed Jun 9, 2020
1 parent 42bfc73 commit e08d205
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions adabot/arduino_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ def validate_travis(repo):
repo_has_travis = requests.get("https://raw.githubusercontent.com/adafruit/" + repo["name"] + "/master/.travis.yml")
return repo_has_travis.ok

def validate_actions(repo):
"""Validate if a repo has actions githubci.yml
"""
repo_has_actions = requests.get("https://raw.githubusercontent.com/adafruit/" + repo["name"] + "/master/.github/workflows/githubci.yml")
return repo_has_actions.ok

def validate_example(repo):
"""Validate if a repo has any files in examples directory
"""
Expand All @@ -181,7 +187,7 @@ def run_arduino_lib_checks():
failed_lib_prop = [[" Repo", "Release Tag", "library.properties Version"], [" ----", "-----------", "--------------------------"]]
needs_release_list = [[" Repo", "Latest Release", "Commits Behind"], [" ----", "--------------", "--------------"]]
needs_registration_list = [[" Repo"], [" ----"]]
missing_travis_list = [[" Repo"], [" ----"]]
missing_ci_list = [[" Repo"], [" ----"]]
missing_library_properties_list = [[" Repo"], [" ----"]]

for repo in repo_list:
Expand Down Expand Up @@ -217,10 +223,10 @@ def run_arduino_lib_checks():
if needs_release:
needs_release_list.append([" " + str(repo["name"]), needs_release[0], needs_release[1]])

missing_travis = not validate_travis(repo)
entry['needs_travis'] = missing_travis
if missing_travis:
missing_travis_list.append([" " + str(repo["name"])])
missing_ci = not validate_travis(repo) and not validate_actions(repo)
entry['needs_ci'] = missing_ci
if missing_ci:
missing_ci_list.append([" " + str(repo["name"])])

all_libraries.append(entry)

Expand All @@ -236,8 +242,8 @@ def run_arduino_lib_checks():
if len(needs_release_list) > 2:
print_list_output("Libraries have commits since last release: ({})", needs_release_list);

if len(missing_travis_list) > 2:
print_list_output("Libraries that is not configured with Travis: ({})", missing_travis_list)
if len(missing_ci_list) > 2:
print_list_output("Libraries that is not configured with Travis or Actions: ({})", missing_ci_list)

if len(missing_library_properties_list) > 2:
print_list_output("Libraries that is missing library.properties file: ({})", missing_library_properties_list)
Expand Down

0 comments on commit e08d205

Please sign in to comment.