Skip to content

Commit

Permalink
Fix status value and add win step to create env
Browse files Browse the repository at this point in the history
  • Loading branch information
yoland68 committed Jul 12, 2024
1 parent ea76020 commit 2d64277
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion action.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import datetime
import json
import os
import pprint
import re
import subprocess
from enum import Enum
Expand Down Expand Up @@ -107,7 +108,7 @@ def send_payload_to_api(
"comfy_run_flags": args.comfy_run_flags,
"python_version": args.python_version,
"torch_version": args.torch_version,
"status": status,
"status": status.value,
}

# Convert payload dictionary to a JSON string
Expand All @@ -116,6 +117,10 @@ def send_payload_to_api(
# Send POST request
headers = {"Content-Type": "application/json"}
response = requests.post(args.api_endpoint, headers=headers, data=payload_json)
print("#### Payload ####")
pprint(payload)
print("#### Response ####")
pprint(response.json())

# Write response to application.log
log_file_path = "./application.log"
Expand Down
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,16 @@ runs:
python-version: ${{ inputs.python_version }}
continue-on-error: true

# This step is created because the Conda setup step fails everytime.
- name: '[Win-Only] Create Conda environment if not exists'
if: ${{ inputs.os == 'windows' }}
shell: powershell
run: |
if (-not (conda env list | Select-String -Pattern "gha-comfyui-${{ inputs.python_version }}-${{ inputs.torch_version }}")) {
conda create -n gha-comfyui-${{ inputs.python_version }}-${{ inputs.torch_version }} python=${{ inputs.python_version }} -y
}
- name: '[Win-Only] Install Pytorch nightly'
if: ${{ inputs.os == 'windows' && inputs.torch_version == 'nightly'}}
shell: powershell
Expand Down

0 comments on commit 2d64277

Please sign in to comment.