Skip to content

Commit

Permalink
Switch to setup-micromamba
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoV94 committed Apr 15, 2024
1 parent bdfbf64 commit eb4c92a
Showing 1 changed file with 14 additions and 66 deletions.
80 changes: 14 additions & 66 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,49 +28,23 @@ jobs:
PYTENSOR_FLAGS: gcc__cxxflags='-march=native'
defaults:
run:
shell: bash -l {0}
shell: bash -leo pipefail {0}
steps:
- uses: actions/checkout@v4
- name: Cache conda
uses: actions/cache@v4
env:
# Increase this value to reset cache if environment-test.yml has not changed
CACHE_NUMBER: 0
- uses: mamba-org/setup-micromamba@v1
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-py${{matrix.python-version}}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/environment-test.yml') }}
- name: Cache multiple paths
uses: actions/cache@v4
env:
# Increase this value to reset cache if requirements.txt has not changed
CACHE_NUMBER: 0
with:
path: |
~/.cache/pip
$RUNNER_TOOL_CACHE/Python/*
~\AppData\Local\pip\Cache
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
mamba-version: "*"
activate-environment: pymc-experimental-test
channel-priority: strict
environment-file: conda-envs/environment-test.yml
python-version: ${{matrix.python-version}}
use-mamba: true
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
create-args: >-
python=${{matrix.python-version}}
environment-name: pymc-experimental-test
init-shell: bash
cache-environment: true
- name: Install pymc-experimental
run: |
conda activate pymc-experimental-test
pip install -e .
python --version
- name: Run tests
run: |
conda activate pymc-experimental-test
python -m pytest -vv --cov=pymc_experimental --cov-append --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
Expand All @@ -92,51 +66,25 @@ jobs:
PYTENSOR_FLAGS: gcc__cxxflags='-march=core2'
defaults:
run:
shell: cmd
shell: cmd /C call {0}
steps:
- uses: actions/checkout@v4
- name: Cache conda
uses: actions/cache@v4
env:
# Increase this value to reset cache if conda-envs/windows-environment-test.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-py${{matrix.python-version}}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/windows-environment-test.yml') }}
- name: Cache multiple paths
uses: actions/cache@v4
env:
# Increase this value to reset cache if requirements.txt has not changed
CACHE_NUMBER: 0
with:
path: |
~/.cache/pip
$RUNNER_TOOL_CACHE/Python/*
~\AppData\Local\pip\Cache
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v3
- uses: mamba-org/setup-micromamba@v1
with:
miniforge-variant: Mambaforge
miniforge-version: latest
mamba-version: "*"
activate-environment: pymc-experimental-test
channel-priority: strict
environment-file: conda-envs/windows-environment-test.yml
python-version: ${{matrix.python-version}}
use-mamba: true
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
create-args: >-
python=${{matrix.python-version}}
environment-name: pymc-experimental-test
init-shell: cmd.exe
cache-environment: true
- name: Install pymc-experimental
run: |
conda activate pymc-experimental-test
pip install -e .
python --version
- name: Run tests
# This job uses a cmd shell, therefore the environment variable syntax is different!
# The ">-" in the next line replaces newlines with spaces (see https://stackoverflow.com/a/66809682).
run: >-
conda activate pymc-experimental-test &&
python -m pytest -vv --cov=pymc_experimental --cov-append --cov-report=xml --cov-report term --durations=50 %TEST_SUBSET%
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
Expand Down

0 comments on commit eb4c92a

Please sign in to comment.