Skip to content

Commit

Permalink
Merge sherpa#2195 (Marie-Terrell) - Update ci-conda-workflow to use M…
Browse files Browse the repository at this point in the history
…iniforge

Update ci-conda-workflow to use Miniforge
  • Loading branch information
wmclaugh authored Nov 8, 2024
2 parents 3fd4bf4 + 64c4395 commit c034afa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
10 changes: 0 additions & 10 deletions .github/scripts/setup_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ else
fi
fi

# Ensure we have set up conda
#
source ${CONDA}/etc/profile.d/conda.sh

# update and add channels
conda update --yes conda
conda config --add channels conda-forge
#Remove defaults to avoid conflicts with conda-forge
conda config --remove channels defaults

# To avoid issues with non-XSPEC builds (e.g.
# https://github.com/sherpa/sherpa/pull/794#issuecomment-616570995 )
# the XSPEC-related channels are only added if needed
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/ci-conda-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ concurrency:
env:
xspec_channel: "https://cxc.cfa.harvard.edu/conda/xspec"
CONDA_BUILD_SYSROOT: ${{ github.workspace }}/11.0SDK/MacOSX11.0.sdk
conda_loc: ${{ github.workspace }}/conda_loc

jobs:
tests:
Expand Down Expand Up @@ -117,14 +118,17 @@ jobs:
BOKEHVER: ${{ matrix.bokeh-version }}
XSPECVER: ${{ matrix.xspec-version }}
run: |
curl -L https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh -o conda-installer.sh
bash conda-installer.sh -b -p ${conda_loc}
source ${conda_loc}/etc/profile.d/conda.sh
source .github/scripts/setup_conda.sh
- name: Conda Setup (Xspec and DS9)
if: matrix.xspec-version != ''
env:
XSPECVER: ${{ matrix.xspec-version }}
run: |
source ${CONDA}/etc/profile.d/conda.sh
source ${conda_loc}/etc/profile.d/conda.sh
conda activate build
if [ "$RUNNER_OS" != "macOS" ]; then
source .github/scripts/setup_ds9.sh
Expand All @@ -138,7 +142,7 @@ jobs:
env:
PYTHON_LDFLAGS: " "
run: |
source ${CONDA}/etc/profile.d/conda.sh
source ${conda_loc}/etc/profile.d/conda.sh
conda activate build
pip install .[test] --verbose
Expand All @@ -147,14 +151,14 @@ jobs:
env:
PYTHON_LDFLAGS: " "
run: |
source ${CONDA}/etc/profile.d/conda.sh
source ${conda_loc}/etc/profile.d/conda.sh
conda activate build
pip install -e .[test] --verbose
- name: Install the test data?
if: matrix.test-data == 'package'
run: |
source ${CONDA}/etc/profile.d/conda.sh
source ${conda_loc}/etc/profile.d/conda.sh
conda activate build
pip install ./sherpa-test-data
Expand All @@ -181,7 +185,7 @@ jobs:
fi
echo "** smoke test: ${smokevars}"
source ${CONDA}/etc/profile.d/conda.sh
source ${conda_loc}/etc/profile.d/conda.sh
conda activate build
cd /home
sherpa_smoke ${smokevars}
Expand Down Expand Up @@ -215,15 +219,15 @@ jobs:
# moment, but leave this in
export PATH="${PATH}:/opt/X11/bin"
fi
source ${CONDA}/etc/profile.d/conda.sh
source ${conda_loc}/etc/profile.d/conda.sh
conda activate build
conda install -yq pytest-cov
pytest --pyargs sherpa --cov sherpa --cov-report xml:${{ github.workspace }}/coverage.xml
- name: sherpa_test Tests
if: matrix.test-data == 'package' || matrix.test-data == 'none'
run: |
source ${CONDA}/etc/profile.d/conda.sh
source ${conda_loc}/etc/profile.d/conda.sh
conda activate build
conda install -yq pytest-cov
cd $HOME
Expand Down

0 comments on commit c034afa

Please sign in to comment.