From 45c8d30c0fceb1112afbae570e48c63f22f9bdcc Mon Sep 17 00:00:00 2001 From: Miranda Mundt Date: Tue, 4 Mar 2025 12:51:35 -0700 Subject: [PATCH] Let's reset here --- .github/workflows/test_branches.yml | 51 +------------------------- .github/workflows/test_pr_and_main.yml | 51 +------------------------- 2 files changed, 2 insertions(+), 100 deletions(-) diff --git a/.github/workflows/test_branches.yml b/.github/workflows/test_branches.yml index 247083b529d..58941dac22c 100644 --- a/.github/workflows/test_branches.yml +++ b/.github/workflows/test_branches.yml @@ -301,36 +301,6 @@ jobs: - name: Install Python packages (conda) if: matrix.PYENV == 'conda' run: | - # Function to install a package with a timeout - install_with_timeout() { - local pkg=$1 - local timeout_duration=30 - - echo "... INSTALLING $pkg" - (conda install -q -y "$pkg") & - conda_pid=$! - - # Set a trap to kill the conda process if the script exits - trap "kill $conda_pid 2>/dev/null" EXIT - - (sleep "$timeout_duration" && kill -INT "$conda_pid" 2>/dev/null) & - timeout_pid=$! - - wait "$conda_pid" - exit_status=$? - - # Clean up the timeout process - kill "$timeout_pid" 2>/dev/null - - # Check if the installation was successful - if [ $exit_status -ne 0 ]; then - echo "ERROR: Installation of $pkg failed (exit status: $exit_status)" - return 1 - fi - - echo "Successfully installed $pkg" - return 0 - } # Set up environment conda config --set always_yes yes conda config --set auto_update_conda false @@ -413,25 +383,7 @@ jobs: # Main installation loop for PKG in $PACKAGES; do - echo "" - echo "*** Install $PKG ***" - _PKGLIST=$(conda search -f "$PKG") || echo "Package $PKG not found" - echo "$_PKGLIST" - _BASE=$(echo "$PKG" | sed 's/[=<>].*//') - _BUILDS=$(echo "$_PKGLIST" | grep "^$_BASE " | sed -r 's/\s+/ /g' | cut -d\ -f3) || echo "" - - if test -n "$_BUILDS"; then - _ISPY=$(echo "$_BUILDS" | grep "^py") || echo "INFO: No python build detected." - _PYOK=$(echo "$_BUILDS" | grep -E "^($PYVER|pyh)") || echo "INFO: No python build matching $PYVER detected." - - if test -z "$_ISPY" -o -n "$_PYOK"; then - install_with_timeout "$PKG" || { - echo "WARNING: $PKG installation failed. Continuing with the next package." - } - fi - else - echo "WARNING: $PKG is not available" - fi + timeout 30 conda install -q -y $PKG || echo "WARNING: $PKG not available or did not install correctly" done fi # Re-try Pyomo (optional) dependencies with pip @@ -460,7 +412,6 @@ jobs: echo "Final conda environment:" conda list | sed 's/^/ /' - - name: Setup TPL package directories run: | TPL_DIR="${GITHUB_WORKSPACE}/cache/tpl" diff --git a/.github/workflows/test_pr_and_main.yml b/.github/workflows/test_pr_and_main.yml index 7f02be5b431..182b16147e4 100644 --- a/.github/workflows/test_pr_and_main.yml +++ b/.github/workflows/test_pr_and_main.yml @@ -338,36 +338,6 @@ jobs: - name: Install Python packages (conda) if: matrix.PYENV == 'conda' run: | - # Function to install a package with a timeout - install_with_timeout() { - local pkg=$1 - local timeout_duration=30 - - echo "... INSTALLING $pkg" - (conda install -q -y "$pkg") & - conda_pid=$! - - # Set a trap to kill the conda process if the script exits - trap "kill $conda_pid 2>/dev/null" EXIT - - (sleep "$timeout_duration" && kill -INT "$conda_pid" 2>/dev/null) & - timeout_pid=$! - - wait "$conda_pid" - exit_status=$? - - # Clean up the timeout process - kill "$timeout_pid" 2>/dev/null - - # Check if the installation was successful - if [ $exit_status -ne 0 ]; then - echo "ERROR: Installation of $pkg failed (exit status: $exit_status)" - return 1 - fi - - echo "Successfully installed $pkg" - return 0 - } # Set up environment conda config --set always_yes yes conda config --set auto_update_conda false @@ -450,25 +420,7 @@ jobs: # Main installation loop for PKG in $PACKAGES; do - echo "" - echo "*** Install $PKG ***" - _PKGLIST=$(conda search -f "$PKG") || echo "Package $PKG not found" - echo "$_PKGLIST" - _BASE=$(echo "$PKG" | sed 's/[=<>].*//') - _BUILDS=$(echo "$_PKGLIST" | grep "^$_BASE " | sed -r 's/\s+/ /g' | cut -d\ -f3) || echo "" - - if test -n "$_BUILDS"; then - _ISPY=$(echo "$_BUILDS" | grep "^py") || echo "INFO: No python build detected." - _PYOK=$(echo "$_BUILDS" | grep -E "^($PYVER|pyh)") || echo "INFO: No python build matching $PYVER detected." - - if test -z "$_ISPY" -o -n "$_PYOK"; then - install_with_timeout "$PKG" || { - echo "WARNING: $PKG installation failed. Continuing with the next package." - } - fi - else - echo "WARNING: $PKG is not available" - fi + timeout 30 conda install -q -y $PKG || echo "WARNING: $PKG not available or did not install correctly" done fi # Re-try Pyomo (optional) dependencies with pip @@ -497,7 +449,6 @@ jobs: echo "Final conda environment:" conda list | sed 's/^/ /' - - name: Setup TPL package directories run: | TPL_DIR="${GITHUB_WORKSPACE}/cache/tpl"