1
0
mirror of https://github.com/konpa/devicon.git synced 2025-08-13 18:14:21 +02:00

Add try-except in icomoon_upload. Workflow will also upload geckodriver.log as an artifact for debugging purpose

This commit is contained in:
Thomas Bui
2020-09-04 10:03:07 -07:00
parent dcdcc6060b
commit a7619e2330
4 changed files with 30 additions and 16 deletions

View File

@@ -59,6 +59,7 @@ def get_svgs_paths(new_icons: List[dict], icons_folder_path: str) -> List[str]:
if not folder_path.is_dir():
raise ValueError(f"Invalid path. This is not a directory: {folder_path}.")
# TODO: remove the try-except when the devicon.json is upgraded
try:
aliases = icon_info["aliases"]
except KeyError:

View File

@@ -1,5 +1,6 @@
from pathlib import Path
from argparse import ArgumentParser
from selenium.common.exceptions import TimeoutException
# pycharm complains that build_assets is an unresolved ref
# don't worry about it, the script still runs
@@ -42,20 +43,25 @@ def main():
print("No files need to be uploaded. Ending script...")
return
runner = SeleniumRunner(args.icomoon_json_path, args.download_path,
args.geckodriver_path, args.headless)
runner.upload_icomoon()
svgs = filehandler.get_svgs_paths(new_icons, args.icons_folder_path)
runner.upload_svgs(svgs)
try:
runner = SeleniumRunner(args.icomoon_json_path, args.download_path,
args.geckodriver_path, args.headless)
runner.upload_icomoon()
svgs = filehandler.get_svgs_paths(new_icons, args.icons_folder_path)
runner.upload_svgs(svgs)
zip_name = "devicon-v1.0.zip"
zip_path = Path(args.download_path, zip_name)
runner.download_icomoon_fonts(zip_path)
filehandler.extract_files(str(zip_path), args.download_path)
filehandler.rename_extracted_files(args.download_path)
runner.close()
print("Task completed.")
zip_name = "devicon-v1.0.zip"
zip_path = Path(args.download_path, zip_name)
runner.download_icomoon_fonts(zip_path)
filehandler.extract_files(str(zip_path), args.download_path)
filehandler.rename_extracted_files(args.download_path)
runner.close()
print("Task completed.")
except TimeoutException as e:
print(e)
print(e.stacktrace)
runner.close()
if __name__ == "__main__":

View File

@@ -1 +1 @@
selenium
selenium==3.141.0

View File

@@ -2,7 +2,10 @@ name: Build Icons
on:
pull_request:
branches:
- build-integrate
- master
push:
branches:
- master
jobs:
build:
name: Get Fonts From Icomoon
@@ -23,9 +26,13 @@ jobs:
run: >
python ./.github/scripts/icomoon_upload.py
./.github/scripts/build_assets/geckodriver-v0.27.0-win64/geckodriver.exe
./icomoon.json ./devicon.json ./icons ./built_files --headless
./icomoon.json ./devicon.json ./icons ./ --headless
- name: Upload geckodriver.log for debugging purposes
uses: actions/upload-artifact@v2
with:
path: ./geckodriver.log
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Built new icons, icomoon.json and devicon.css
branch: action-fix
branch: build-integrate