mirror of
https://github.com/konpa/devicon.git
synced 2025-08-14 02:24:04 +02:00
Feature: Peek and Build-Bot Upgrade (#806)
* Refactored peek script into a class * Post-peek workflow now upload the new screenshots * Refactored BuildSeleniumRunner into a class * Updated build_icons.yml to reflect new changes * Fixed issue with building icons that were already in the app * Build script will take screenshot of new icons * Update post peek yaml message * Added alerts * Peek script now check for strokes in icons * Updated post_peek's strokes in svgs message * Updated post_peek script's message * Updated post_peek's message * Refactored get_release_message into icomoon_build * Change devicon.css name to devicon-base.css * Updated post_peek message * Added update icon as a valid PR title for bot-peek * Add \n char to SVG after it gets optimized * Fixed error with 'update icon' regex * Build script now batch issues when upload SVG * Addressed build-bot's screenshot order * Apply suggestions from code review Co-authored-by: David Leal <halfpacho@gmail.com> Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
23
.github/scripts/icomoon_peek.py
vendored
23
.github/scripts/icomoon_peek.py
vendored
@@ -1,11 +1,4 @@
|
||||
from typing import List
|
||||
import re
|
||||
import sys
|
||||
from selenium.common.exceptions import TimeoutException
|
||||
|
||||
# pycharm complains that build_assets is an unresolved ref
|
||||
# don't worry about it, the script still runs
|
||||
from build_assets.SeleniumRunner import SeleniumRunner
|
||||
from build_assets.selenium_runner.PeekSeleniumRunner import PeekSeleniumRunner
|
||||
from build_assets import filehandler, arg_getters
|
||||
from build_assets import util
|
||||
|
||||
@@ -21,19 +14,23 @@ def main():
|
||||
check_devicon_object(filtered_icon)
|
||||
print("Icon being checked:", filtered_icon, sep = "\n", end='\n\n')
|
||||
|
||||
runner = SeleniumRunner(args.download_path, args.geckodriver_path, args.headless)
|
||||
runner = PeekSeleniumRunner(args.download_path, args.geckodriver_path, args.headless)
|
||||
svgs = filehandler.get_svgs_paths([filtered_icon], args.icons_folder_path, True)
|
||||
screenshot_folder = filehandler.create_screenshot_folder("./")
|
||||
runner.upload_svgs(svgs, screenshot_folder)
|
||||
svgs_with_strokes = runner.peek(svgs, screenshot_folder)
|
||||
print("Task completed.")
|
||||
|
||||
# no errors, do this so upload-artifact won't fail
|
||||
filehandler.write_to_file("./err_messages.txt", "0")
|
||||
message = ""
|
||||
if svgs_with_strokes != []:
|
||||
svgs_str = "\n\n".join(svgs_with_strokes)
|
||||
message = "\n### WARNING -- Strokes detected in the following SVGs:\n" + svgs_str + "\n"
|
||||
filehandler.write_to_file("./err_messages.txt", message)
|
||||
except Exception as e:
|
||||
filehandler.write_to_file("./err_messages.txt", str(e))
|
||||
util.exit_with_err(e)
|
||||
finally:
|
||||
runner.close()
|
||||
if runner is not None:
|
||||
runner.close()
|
||||
|
||||
|
||||
def check_devicon_object(icon: dict):
|
||||
|
Reference in New Issue
Block a user