mirror of
https://github.com/konpa/devicon.git
synced 2025-08-15 02:56:12 +02:00
Added a comment action and fix async issue in python script
This commit is contained in:
13
.github/scripts/build_assets/SeleniumRunner.py
vendored
13
.github/scripts/build_assets/SeleniumRunner.py
vendored
@@ -76,6 +76,14 @@ class SeleniumRunner:
|
|||||||
self.driver.get(self.ICOMOON_URL)
|
self.driver.get(self.ICOMOON_URL)
|
||||||
assert "IcoMoon App" in self.driver.title
|
assert "IcoMoon App" in self.driver.title
|
||||||
|
|
||||||
|
# wait until the whole web page is loaded by testing the hamburger input
|
||||||
|
hamburger_input = WebDriverWait(self.driver, SeleniumRunner.LONG_WAIT_IN_SEC).until(
|
||||||
|
ec.element_to_be_clickable((By.CSS_SELECTOR,
|
||||||
|
"button.btn5.lh-def.transparent i.icon-menu"))
|
||||||
|
)
|
||||||
|
hamburger_input.click()
|
||||||
|
print("Accessed icomoon.io")
|
||||||
|
|
||||||
def upload_icomoon(self, icomoon_json_path: str):
|
def upload_icomoon(self, icomoon_json_path: str):
|
||||||
"""
|
"""
|
||||||
Upload the icomoon.json to icomoon.io.
|
Upload the icomoon.json to icomoon.io.
|
||||||
@@ -86,7 +94,7 @@ class SeleniumRunner:
|
|||||||
try:
|
try:
|
||||||
# find the file input and enter the file path
|
# find the file input and enter the file path
|
||||||
import_btn = WebDriverWait(self.driver, SeleniumRunner.LONG_WAIT_IN_SEC).until(
|
import_btn = WebDriverWait(self.driver, SeleniumRunner.LONG_WAIT_IN_SEC).until(
|
||||||
ec.presence_of_element_located((By.CSS_SELECTOR, "div#file input"))
|
ec.element_to_be_clickable((By.CSS_SELECTOR, "div#file input"))
|
||||||
)
|
)
|
||||||
import_btn.send_keys(icomoon_json_path)
|
import_btn.send_keys(icomoon_json_path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -138,6 +146,7 @@ class SeleniumRunner:
|
|||||||
ec.element_to_be_clickable((By.XPATH, "//button[text()='Select All']"))
|
ec.element_to_be_clickable((By.XPATH, "//button[text()='Select All']"))
|
||||||
)
|
)
|
||||||
select_all_button.click()
|
select_all_button.click()
|
||||||
|
print("Finished uploading the svgs...")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.close()
|
self.close()
|
||||||
raise e
|
raise e
|
||||||
@@ -155,7 +164,7 @@ class SeleniumRunner:
|
|||||||
)
|
)
|
||||||
|
|
||||||
menu_appear_callback = ec.element_to_be_clickable(
|
menu_appear_callback = ec.element_to_be_clickable(
|
||||||
(By.CSS_SELECTOR, "h1#setH2 ul")
|
(By.CSS_SELECTOR, "h1 ul.menuList2")
|
||||||
)
|
)
|
||||||
|
|
||||||
while not menu_appear_callback(self.driver):
|
while not menu_appear_callback(self.driver):
|
||||||
|
17
.github/workflows/peek_icons.yml
vendored
17
.github/workflows/peek_icons.yml
vendored
@@ -21,15 +21,9 @@ jobs:
|
|||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -r ./.github/scripts/requirements.txt
|
pip install -r ./.github/scripts/requirements.txt
|
||||||
npm install
|
npm install
|
||||||
<<<<<<< HEAD
|
|
||||||
- name: Run icomoon_peek.py
|
- name: Run icomoon_peek.py
|
||||||
run: >
|
run: >
|
||||||
python ./.github/scripts/icomoon_peek.py
|
python ./.github/scripts/icomoon_peek.py
|
||||||
=======
|
|
||||||
- name: Run icomoon_upload.py
|
|
||||||
run: >
|
|
||||||
python ./.github/scripts/icomoon_upload.py
|
|
||||||
>>>>>>> 89412c2... Added a peek script
|
|
||||||
./.github/scripts/build_assets/geckodriver-v0.27.0-win64/geckodriver.exe
|
./.github/scripts/build_assets/geckodriver-v0.27.0-win64/geckodriver.exe
|
||||||
./icomoon.json ./devicon.json ./icons ./ --headless
|
./icomoon.json ./devicon.json ./icons ./ --headless
|
||||||
- name: Upload geckodriver.log for debugging purposes
|
- name: Upload geckodriver.log for debugging purposes
|
||||||
@@ -43,14 +37,12 @@ jobs:
|
|||||||
if: ${{success()}}
|
if: ${{success()}}
|
||||||
with:
|
with:
|
||||||
name: new_icons
|
name: new_icons
|
||||||
<<<<<<< HEAD
|
|
||||||
path: ./new_icons.png
|
path: ./new_icons.png
|
||||||
=======
|
- name: Comment on the PR about the result
|
||||||
path: ./new_icons.png
|
uses: github-actions-up-and-running/pr-comment@v1.0.1
|
||||||
- name: Create a comment alerting that the bot peeked
|
|
||||||
uses: peter-evans/commit-comment@v1
|
|
||||||
with:
|
with:
|
||||||
body: >
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
message: >
|
||||||
Hi! I'm Devicons' GitHub Actions Bot!
|
Hi! I'm Devicons' GitHub Actions Bot!
|
||||||
|
|
||||||
I just peeked at the icons that you wanted to add and upload them to the
|
I just peeked at the icons that you wanted to add and upload them to the
|
||||||
@@ -59,4 +51,3 @@ jobs:
|
|||||||
|
|
||||||
Cheers :),
|
Cheers :),
|
||||||
Bot
|
Bot
|
||||||
>>>>>>> 89412c2... Added a peek script
|
|
||||||
|
Reference in New Issue
Block a user