Skip to content

Commit

Permalink
Get rid of python-version specific conda test environments
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoV94 committed Jun 20, 2022
1 parent 45a816e commit a383526
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 91 deletions.
63 changes: 34 additions & 29 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ jobs:
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache if environment-test-py37.yml has not changed
# Increase this value to reset cache if environment-test.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/environment-test-py37.yml') }}
hashFiles('conda-envs/environment-test.yml') }}
- name: Cache multiple paths
uses: actions/cache@v3
env:
Expand All @@ -111,20 +111,21 @@ jobs:
miniforge-variant: Mambaforge
miniforge-version: latest
mamba-version: "*"
activate-environment: pymc-test-py37
activate-environment: pymc-test
channel-priority: strict
environment-file: conda-envs/environment-test-py37.yml
environment-file: conda-envs/environment-test.yml
python-version: "3.7"
use-mamba: true
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install-pymc
run: |
conda activate pymc-test-py37
conda activate pymc-test
pip install -e .
pip install --pre -U polyagamma
python --version
- name: Run tests
run: |
conda activate pymc-test-py37
conda activate pymc-test
python -m pytest -vv --cov=pymc --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
Expand Down Expand Up @@ -156,12 +157,12 @@ jobs:
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache if conda-envs/environment-test-py38.yml has not changed
# 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 }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/windows-environment-test-py38.yml') }}
hashFiles('conda-envs/windows-environment-test.yml') }}
- name: Cache multiple paths
uses: actions/cache@v3
env:
Expand All @@ -179,22 +180,23 @@ jobs:
miniforge-variant: Mambaforge
miniforge-version: latest
mamba-version: "*"
activate-environment: pymc-test-py38
activate-environment: pymc-test
channel-priority: strict
environment-file: conda-envs/windows-environment-test-py38.yml
environment-file: conda-envs/windows-environment-test.yml
python-version: "3.8"
use-mamba: true
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install-pymc
run: |
conda activate pymc-test-py38
conda activate pymc-test
pip install -e .
pip install --pre -U polyagamma
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-test-py38 &&
conda activate pymc-test &&
python -m pytest -vv --cov=pymc --cov-report=xml --cov-report term --durations=50 %TEST_SUBSET%
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
Expand Down Expand Up @@ -232,12 +234,12 @@ jobs:
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache if environment-test-py39.yml has not changed
# Increase this value to reset cache if environment-test.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/environment-test-py39.yml') }}
hashFiles('conda-envs/environment-test.yml') }}
- name: Cache multiple paths
uses: actions/cache@v3
env:
Expand All @@ -255,14 +257,15 @@ jobs:
miniforge-variant: Mambaforge
miniforge-version: latest
mamba-version: "*"
activate-environment: pymc-test-py39
activate-environment: pymc-test
channel-priority: strict
environment-file: conda-envs/environment-test-py39.yml
environment-file: conda-envs/environment-test.yml
python-version: "3.9"
use-mamba: true
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install pymc
run: |
conda activate pymc-test-py39
conda activate pymc-test
pip install -e .
python --version
- name: Run tests
Expand Down Expand Up @@ -294,12 +297,12 @@ jobs:
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache if environment-test-py39.yml has not changed
# Increase this value to reset cache if environment-test.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/environment-test-py39.yml') }}
hashFiles('conda-envs/environment-test.yml') }}
- name: Cache multiple paths
uses: actions/cache@v3
env:
Expand All @@ -317,19 +320,20 @@ jobs:
miniforge-variant: Mambaforge
miniforge-version: latest
mamba-version: "*"
activate-environment: pymc-test-py39
activate-environment: pymc-test
channel-priority: strict
environment-file: conda-envs/environment-test-py39.yml
environment-file: conda-envs/environment-test.yml
python-version: "3.9"
use-mamba: true
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install pymc
run: |
conda activate pymc-test-py39
conda activate pymc-test
pip install -e .
python --version
- name: Install jax specific dependencies
run: |
conda activate pymc-test-py39
conda activate pymc-test
pip install "numpyro>=0.8.0"
pip install git+https://github.com/blackjax-devs/[email protected]
- name: Run tests
Expand Down Expand Up @@ -361,12 +365,12 @@ jobs:
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache if conda-envs/environment-test-py38.yml has not changed
# 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 }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/windows-environment-test-py38.yml') }}
hashFiles('conda-envs/windows-environment-test.yml') }}
- name: Cache multiple paths
uses: actions/cache@v3
env:
Expand All @@ -384,22 +388,23 @@ jobs:
miniforge-variant: Mambaforge
miniforge-version: latest
mamba-version: "*"
activate-environment: pymc-test-py38
activate-environment: pymc-test
channel-priority: strict
environment-file: conda-envs/windows-environment-test-py38.yml
environment-file: conda-envs/windows-environment-test.yml
python-verision: "3.8"
use-mamba: true
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install-pymc
run: |
conda activate pymc-test-py38
conda activate pymc-test
pip install -e .
pip install --pre -U polyagamma
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-test-py38 &&
conda activate pymc-test &&
python -m pytest -vv --cov=pymc --cov-report=xml --cov-report term --durations=50 %TEST_SUBSET%
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
Expand Down
29 changes: 0 additions & 29 deletions conda-envs/environment-test-py38.yml

This file was deleted.

29 changes: 0 additions & 29 deletions conda-envs/environment-test-py39.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# "test" conda envs are used to set up our CI environment in GitHub actions
name: pymc-test-py37
name: pymc-test
channels:
- conda-forge
- defaults
Expand All @@ -18,7 +18,6 @@ dependencies:
- mkl-service
- numpy>=1.15.0
- pandas>=0.24.0
- python=3.7
- python-graphviz
- scipy>=1.4.1
- typing-extensions>=3.7.4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# "test" conda envs are used to set up our CI environment in GitHub actions
name: pymc-test-py38
name: pymc-test
channels:
- conda-forge
- defaults
Expand All @@ -20,7 +20,6 @@ dependencies:
- numpy>=1.15.0
- pandas>=0.24.0
- pip
- python=3.8
- python-graphviz
- scipy>=1.4.1
- typing-extensions>=3.7.4
Expand Down

0 comments on commit a383526

Please sign in to comment.