Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 46 additions & 16 deletions .github/workflows/test_CondaEnv.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Conda Env Verified (Ubuntu & MacOS)'
name: 'Test Conda Environment File with Miniforge (Including M-series)'

on:
pull_request:
Expand All @@ -7,23 +7,53 @@ on:
- '.github/workflows/**'

jobs:
build-conda-env:
validate-conda-env:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
max-parallel: 5
include:
- os: macos-latest
arch: osx-arm64 # M-series
- os: macos-latest
arch: osx-64 # Intel
- os: ubuntu-latest
arch: linux-64
max-parallel: 5
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: mamba-org/setup-micromamba@v1
with:
environment-file: false
- name: Install Conda Environment on MacOS
if: matrix.os == 'macos-latest'
run: |
micromamba env create --platform osx-64 --file anaconda-env.yml
- name: Install Conda Environment on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
micromamba env create --file anaconda-env.yml
- name: Check out repository
uses: actions/checkout@v3

- name: Install Miniforge
shell: bash
run: |
if [ $RUNNER_OS == "macOS" ]; then
if [ "${{ matrix.arch }}" == "osx-arm64" ]; then
MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh"
else
MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh"
fi
else
MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh"
fi
curl -L $MINIFORGE_URL -o Miniforge3.sh
bash Miniforge3.sh -b -p $HOME/miniforge
echo "$HOME/miniforge/bin" >> $GITHUB_PATH
source $HOME/miniforge/bin/activate

- name: Validate Conda Environment File
shell: bash
run: |
conda env create --name test_env --file anaconda-env.yml --dry-run --force

- name: Create and Activate Environment
shell: bash
run: |
conda env create --name test_env --file anaconda-env.yml
source activate test_env

- name: Test Environment Installation
shell: bash
run: |
python --version
conda list