Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] generate conda envs also for all possible OS #1302

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
23 changes: 18 additions & 5 deletions .github/workflows/caches_cron_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ jobs:

create-conda-env-cache-if-missing:
name: Caching conda env
runs-on: "ubuntu-latest"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
defaults:
# by default run in bash mode (required for conda usage)
run:
Expand All @@ -38,7 +40,7 @@ jobs:
# * when package dependencies change
id: cache-conda-env
with:
path: /usr/share/miniconda/envs/neo-test-env
path: envs/neo-test-env
key: ${{ runner.os }}-conda-env-${{ steps.dependencies.outputs.hash }}-${{ steps.date.outputs.date }}

- name: Cache found?
Expand All @@ -48,10 +50,21 @@ jobs:
- uses: conda-incubator/[email protected]
if: steps.cache-conda-env.outputs.cache-hit != 'true'
with:
activate-environment: neo-test-env
activate-environment: ~/envs/neo-test-env
environment-file: environment_testing.yml
python-version: 3.9

- name: Installing datalad and git-annex
if: steps.cache-conda-env.outputs.cache-hit != 'true'
run: |
git config --global user.email "neo_ci@fake_mail.com"
git config --global user.name "neo CI"
python -m pip install -U pip # Official recommended way
pip install datalad-installer
datalad-installer --sudo ok --bin-dir ~/envs/neo-test-env/ git-annex --method datalad/packages
pip install datalad
git config --global filter.annex.process "git-annex filter-process" # recommended for efficiency

- name: Create the conda environment to be cached
if: steps.cache-conda-env.outputs.cache-hit != 'true'
# create conda env, configure git and install pip, neo and test dependencies from master
Expand All @@ -63,7 +76,7 @@ jobs:
pip install --upgrade -e .[test]

create-data-cache-if-missing:
name: Caching data env
name: Caching data
runs-on: "ubuntu-latest"
steps:

Expand All @@ -89,7 +102,7 @@ jobs:
git config --global user.name "neo CI"
python -m pip install -U pip # Official recommended way
pip install datalad-installer
datalad-installer --sudo ok git-annex --method datalad/packages
datalad-installer --sudo ok git-annex=8 --method datalad/packages
pip install datalad
git config --global filter.annex.process "git-annex filter-process" # recommended for efficiency

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/io-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: neo-test-env
activate-environment: ~/envs/neo-test-env
python-version: ${{ matrix.python-version }}

- name: Get current dependencies hash
Expand All @@ -62,7 +62,7 @@ jobs:
# * when package dependencies change
id: cache-conda-env
with:
path: /usr/share/miniconda/envs/neo-test-env
path: ~/envs/neo-test-env
key: ${{ runner.os }}-conda-env-${{ steps.dependencies.outputs.hash }}-${{ steps.date.outputs.date }}
# restore-keys match any key that starts with the restore-key
restore-keys: |
Expand All @@ -74,7 +74,7 @@ jobs:
# restore-key hits should result in `cache-hit` == 'false'
if: steps.cache-conda-env.outputs.cache-hit != 'true'
run: |
conda env update --name neo-test-env --file environment_testing.yml --prune
conda env update --prefix ~/envs --name neo-test-env --file environment_testing.yml --prune

- name: Configure git
run: |
Expand Down