diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4853dc5..50ecd0b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ env: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} jobs: - Network-Connected-Test-13: + Network-Connected-Test-macOS13: runs-on: macOS-13 steps: - name: Checkout @@ -21,7 +21,7 @@ jobs: run: bash sd-installer.sh -t -1 | grep -q 'Launching Web UI with arguments' && echo '成功 Success' && exit 0 shell: /bin/bash --noprofile --norc -e {0} - Network-Connected-Test-12: + Network-Connected-Test-macOS12: runs-on: macos-12 steps: - name: Checkout @@ -36,6 +36,11 @@ jobs: Network-Not-Connected-Test: runs-on: macos-latest steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: sd-installer.sh + sparse-checkout-cone-mode: false - name: Install - run: curl -fsSL https://ghproxy.com/https://raw.githubusercontent.com/wy-luke/StableDiffusion-Installer-For-Mac/$BRANCH_NAME/sd-installer.sh | /bin/bash -s -- -c -t -2 # | grep -q 'Launching Web UI with arguments' && echo '成功 Success' && exit 0 + run: bash sd-installer.sh -t -2 | grep -q 'Launching Web UI with arguments' && echo '成功 Success' && exit 0 shell: /bin/bash --noprofile --norc -e {0} diff --git a/sd-installer.sh b/sd-installer.sh index d7efd6c..72edff9 100755 --- a/sd-installer.sh +++ b/sd-installer.sh @@ -174,15 +174,6 @@ if ! command -v brew &>/dev/null; then yes | /bin/bash -c $brew_installer_path eval "$($brew_path shellenv)" verify_installation brew - - if [ "$network_connected" == false ]; then - export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api" - export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" - export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git" - export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git" - export HOMEBREW_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple" - fi - brew update else echo_red "Homebrew 安装文件下载失败, 请检查网络连接" echo_red "Failed to download Homebrew installation script, please check your network connection" @@ -193,6 +184,15 @@ else echo_green "Homebrew has already been installed" fi +if [ "$network_connected" == false ]; then + export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api" + export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" + export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git" + export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git" + export HOMEBREW_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple" +fi +brew update + echo_green "Install the packages required" brew install cmake protobuf rust git wget # brew install --cask cmake