Skip to content

Commit

Permalink
Environment testing for gh workflows [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
robballantyne committed Apr 13, 2024
1 parent efadabb commit 0237007
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build Env

on:
workflow_dispatch:

env:
UBUNTU_VERSION: 22.04
BUILDX_NO_DEFAULT_ATTESTATIONS: 1
# Conservative defaults for cloud providers
LATEST_CPU: "newbase-2.2.0-py3.10-cpu-22.04"

jobs:
cpu-base:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
var:
- {latest: "true", sha: "", python: "3.10", pytorch: "2.2.0"}
- {latest: "false", sha: "abc1234", python: "3.10", pytorch: "2.2.0"}
steps:
-
name: Env Setter
run: |
echo "PACKAGE_NAME=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
-
name: Set tags
run: |
img_path="ghcr.io/${{ env.PACKAGE_NAME }}"
echo "Image Path: ${img_path}"
if [[ -z '${{ matrix.var.sha }}' ]]; then
COMFYUI_SHA="$(curl -fsSL "https://api.github.com/repos/comfyanonymous/ComfyUI/commits/master" | jq -r '.sha[0:7]')"
else
COMFYUI_SHA="${{ matrix.var.sha }}"
fi
[ -z "$COMFYUI_SHA" ] && { echo "Error: COMFYUI_SHA is empty. Exiting script." >&2; exit 1; }
base_tag="newbase-${{ matrix.var.pytorch }}-py${{ matrix.var.python }}-cpu-${{ env.UBUNTU_VERSION }}"
echo "Base Tag: ${base_tag}"
sha_tag="${COMFYUI_SHA}-${base_tag}"
echo "SHA Tag: ${sha_tag}"
TAGS="${img_path}:${sha_tag}"
if [[ ${{ matrix.var.latest }} == "true" ]]; then
echo "Marking latest"
TAGS+=", ${img_path}:latest-cpu, ${img_path}:latest-cpu-jupyter"
fi
echo "All Tags: ${TAGS}"
echo "COMFYUI_SHA=${COMFYUI_SHA}" >> ${GITHUB_ENV}
echo "TAGS=${TAGS}" >> ${GITHUB_ENV}
# Print envs
env

0 comments on commit 0237007

Please sign in to comment.