Skip to content

Commit

Permalink
Merge pull request #308 from bknueven/gha_macos
Browse files Browse the repository at this point in the history
Fix macos GHA
  • Loading branch information
bknueven authored May 23, 2023
2 parents c60ffed + efc1961 commit bbeb5b0
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions .github/workflows/egret.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
python-version: '3.11'
pyomo-version: 6.4.3
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
Expand All @@ -56,38 +56,37 @@ jobs:
conda list
- name: Install Solvers
run: |
if [ ${{ matrix.os }} = macos-latest ]
then
conda install -c conda-forge coincbc ipopt
# download IPOPT & CBC from idaes-ext
echo "...downloading solvers"
SOLVER_DIR="${GITHUB_WORKSPACE}/cache/solvers"
mkdir -p "$SOLVER_DIR"
echo "$SOLVER_DIR" >> $GITHUB_PATH
DOWNLOAD_DIR="${GITHUB_WORKSPACE}/cache/download"
mkdir -p "$DOWNLOAD_DIR"
SOLVER_TAR=${DOWNLOAD_DIR}/solvers.tar.gz
URL=https://github.com/IDAES/idaes-ext
RELEASE=$(curl --max-time 150 --retry 8 \
-L -s -H 'Accept: application/json' ${URL}/releases/latest)
VER=$(echo $RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
URL=${URL}/releases/download/$VER
if test "${{matrix.os}}" == ubuntu-20.04; then
curl --max-time 150 --retry 8 \
-L $URL/idaes-solvers-ubuntu2004-x86_64.tar.gz \
> $SOLVER_TAR
elif test "${{matrix.os}}" == macos-latest; then
curl --max-time 150 --retry 8 \
-L $URL/idaes-solvers-darwin-x86_64.tar.gz \
> $SOLVER_TAR
else
# download IPOPT & CBC from idaes-ext
echo "...downloading solvers"
SOLVER_DIR="${GITHUB_WORKSPACE}/cache/solvers"
mkdir -p "$SOLVER_DIR"
echo "$SOLVER_DIR" >> $GITHUB_PATH
DOWNLOAD_DIR="${GITHUB_WORKSPACE}/cache/download"
mkdir -p "$DOWNLOAD_DIR"
SOLVER_TAR=${DOWNLOAD_DIR}/solvers.tar.gz
URL=https://github.com/IDAES/idaes-ext
RELEASE=$(curl --max-time 150 --retry 8 \
-L -s -H 'Accept: application/json' ${URL}/releases/latest)
VER=$(echo $RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
URL=${URL}/releases/download/$VER
if test "${{matrix.os}}" == ubuntu-20.04; then
curl --max-time 150 --retry 8 \
-L $URL/idaes-solvers-ubuntu2004-x86_64.tar.gz \
> $SOLVER_TAR
else
curl --max-time 150 --retry 8 \
-L $URL/idaes-solvers-windows-x86_64.tar.gz \
$URL/idaes-lib-windows-x86_64.tar.gz > $SOLVER_TAR
fi
cd $SOLVER_DIR
tar -xzi < $SOLVER_TAR
echo ""
echo "$SOLVER_DIR"
ls -l $SOLVER_DIR
curl --max-time 150 --retry 8 \
-L $URL/idaes-solvers-windows-x86_64.tar.gz \
$URL/idaes-lib-windows-x86_64.tar.gz > $SOLVER_TAR
fi
cd $SOLVER_DIR
tar -xz < $SOLVER_TAR
echo ""
echo "$SOLVER_DIR"
ls -l $SOLVER_DIR
- name: Install Parameterized/Pytest
run: |
pip install parameterized pytest coveralls
Expand Down

0 comments on commit bbeb5b0

Please sign in to comment.