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:
1
.github/scripts/build_assets/filehandler.py
vendored
1
.github/scripts/build_assets/filehandler.py
vendored
@@ -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:
|
||||
|
6
.github/scripts/icomoon_upload.py
vendored
6
.github/scripts/icomoon_upload.py
vendored
@@ -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,6 +43,7 @@ def main():
|
||||
print("No files need to be uploaded. Ending script...")
|
||||
return
|
||||
|
||||
try:
|
||||
runner = SeleniumRunner(args.icomoon_json_path, args.download_path,
|
||||
args.geckodriver_path, args.headless)
|
||||
runner.upload_icomoon()
|
||||
@@ -56,6 +58,10 @@ def main():
|
||||
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__":
|
||||
|
2
.github/scripts/requirements.txt
vendored
2
.github/scripts/requirements.txt
vendored
@@ -1 +1 @@
|
||||
selenium
|
||||
selenium==3.141.0
|
13
.github/workflows/build_icons.yml
vendored
13
.github/workflows/build_icons.yml
vendored
@@ -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
|
||||
|
Reference in New Issue
Block a user