Skip to content

Commit

Permalink
align unix with windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 10, 2024
1 parent cbf9c42 commit b7edcf9
Showing 1 changed file with 35 additions and 28 deletions.
63 changes: 35 additions & 28 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ runs:
with:
credentials_json: "${{ inputs.google_credentials }}"

- name: '[Unix] Setup Conda'
uses: conda-incubator/setup-miniconda@v3
if: ${{ inputs.os != 'windows' }}
with:
activate-environment: comfyui
auto-activate-base: false
environment-file: ${{ inputs.conda_env_file }}
use-only-tar-bz2: true
# - name: '[Unix] Setup Conda'
# uses: conda-incubator/setup-miniconda@v3
# if: ${{ inputs.os != 'windows' }}
# with:
# activate-environment: comfyui
# auto-activate-base: false
# environment-file: ${{ inputs.conda_env_file }}
# use-only-tar-bz2: true

- name: '[Unix] Check conda environment'
if: ${{ inputs.os != 'windows' }}
Expand All @@ -103,20 +103,20 @@ runs:
conda list
shell: bash -el {0}

- name: '[Unix] Generate hash from models-json'
if: ${{ inputs.os != 'windows' }}
id: generate_hash
run: |
echo "hash=$(echo '${{ inputs.models-json }}' | sha256sum | cut -d ' ' -f1)" >> $GITHUB_OUTPUT
shell: bash
# - name: '[Unix] Generate hash from models-json'
# if: ${{ inputs.os != 'windows' }}
# id: generate_hash
# run: |
# echo "hash=$(echo '${{ inputs.models-json }}' | sha256sum | cut -d ' ' -f1)" >> $GITHUB_OUTPUT
# shell: bash

- name: '[Unix] Cache models'
if: ${{ inputs.os != 'windows' }}
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/models
key: ${{ runner.os }}-models-${{ steps.generate_hash.outputs.hash }}
save-always: true
# - name: '[Unix] Cache models'
# if: ${{ inputs.os != 'windows' }}
# uses: actions/cache@v4
# with:
# path: ${{ github.workspace }}/models
# key: ${{ runner.os }}-models-${{ steps.generate_hash.outputs.hash }}
# save-always: true

- name: '[Unix] Download models'
if: ${{ inputs.os != 'windows' }}
Expand Down Expand Up @@ -162,17 +162,24 @@ runs:
echo "Running workflows: ${{inputs.workflow_filenames}}"
python3 action.py --comfy-workflow-names ${{ inputs.workflow_filenames }} --github-action-workflow-name "${{ github.workflow }}" --os "${{ inputs.os }}" --run-id "${{ github.run_id }}" --gsc-bucket-name "${{ inputs.gcs_bucket_name }}" --workspace-path "${{ github.workspace }}" --output-file-prefix ${{ inputs.output_prefix }} --repo "${{ github.repository }}" --commit-hash "${{ steps.unix_get_commit_details.outputs.commit_hash }}" --commit-time "${{ steps.unix_get_commit_details.outputs.commit_time }}" --commit-message "${{ steps.unix_get_commit_details.outputs.commit_title }}" --branch-name "${{ github.ref_name }}" --api-endpoint "${{ inputs.api_endpoint }}"
- name: '[Unix] Upload Output Files'
uses: actions/upload-artifact@v4
if: ${{ inputs.os != 'windows' && ( success() || failure() ) }}
with:
name: output-files-${{ github.job }}-${{ inputs.os }}-${{inputs.workflow_name}}-${{ github.run_id }}
path: ${{ github.workspace }}/output/**

- name: '[Unix] Upload log file'
if: ${{ inputs.os != 'windows' }}
uses: actions/upload-artifact@v4
with:
name: app-logs-${{ github.job }}-${{ inputs.os }}-${{inputs.workflow_name}}-${{ github.run_id }}
path: ${{ github.workspace }}/application.log

# - name: '[Unix] Cleanup Repo'
# if: ${{ inputs.os != 'windows' && ( success() || failure() ) }}
# shell: bash -el {0}
# run: rm -rf ${{ github.workspace }}/*
- name: '[Unix] Cleanup output files only'
if: ${{ inputs.os != 'windows' && ( success() || failure() ) }}
shell: powershell
run: rm -rf ${{ github.workspace }}/*

# - name: '[Unix] Cleanup Conda'
# if: ${{ inputs.os != 'windows' && ( success() || failure() ) }}
Expand Down Expand Up @@ -235,7 +242,7 @@ runs:
# shell: powershell


# - name: '[Windows] Cache models'
# - name: '[Win] Cache models'
# if: ${{ inputs.os == 'windows' }}
# uses: actions/cache@v4
# with:
Expand All @@ -252,7 +259,7 @@ runs:
cp "C:\actions-runner\v1-5-pruned-emaonly.ckpt" "$Env:GITHUB_WORKSPACE/models/checkpoints"
shell: powershell

# - name: '[Windows] Download models'
# - name: '[Win] Download models'
# if: ${{ inputs.os == 'windows' }}
# shell: powershell
# run: |
Expand Down Expand Up @@ -295,7 +302,7 @@ runs:
"commit_title=$message" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append
"commit_hash=$commit_hash" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append
- name: '[Windows] Queue Prompts'
- name: '[Win] Queue Prompts'
id: windows_action
if: ${{ inputs.os == 'windows' }}
shell: powershell
Expand Down

0 comments on commit b7edcf9

Please sign in to comment.