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

use conda-incubator/setup-miniconda to setup environment #53

Merged
merged 5 commits into from
Oct 18, 2024
Merged
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
33 changes: 22 additions & 11 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,35 @@ jobs:
defaults:
run:
shell: bash -el {0}
strategy:
max-parallel: 5

steps:
- uses: actions/checkout@v4
- name: Checkout git repository
uses: actions/checkout@v4

- name: Setup headless display
uses: pyvista/setup-headless-display-action@v2

- name: Create conda environment
uses: mamba-org/setup-micromamba@v1
- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Conda env
uses: actions/cache@v4
with:
environment-file: environment_dev.yml
micromamba-version: 'latest'
cache-environment: true
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('environment_dev.yml') }}-${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if environment_dev.yml has not changed
CACHE_NUMBER: 0
id: cache

- name: Conda info
run: conda info
- name: Update environment
run: conda env update -n cedalion -f environment_dev.yml
if: steps.cache.outputs.cache-hit != 'true'

- name: Install cedalion
run: |
Expand All @@ -54,4 +65,4 @@ jobs:
with:
name: docs-${{ github.ref_name }}
path: docs/_build/html
retention-days: 14
retention-days: 2
45 changes: 32 additions & 13 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,50 @@ jobs:
run_pytest:
strategy:
matrix:
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
os: [ubuntu-latest, macos-13, macos-latest, windows-lastest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v4
- name: Checkout git repository
uses: actions/checkout@v4

- name: Create conda environment
uses: mamba-org/setup-micromamba@v1
- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment_dev.yml
micromamba-version: 'latest'
cache-environment: true
miniforge-version: latest
activate-environment: cedalion

- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Conda env
uses: actions/cache@v4
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('environment_dev.yml') }}-${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if environment_dev.yml has not changed
CACHE_NUMBER: 0
id: cache

- name: Update environment
run: conda env update -n cedalion -f environment_dev.yml
if: steps.cache.outputs.cache-hit != 'true'

- name: Install cedalion
run: |
python -m pip install -e . --no-deps --force-reinstall
run: python -m pip install -e . --no-deps --force-reinstall

- name: Install nirfaster
run: |
bash install_nirfaster.sh CPU
run: bash install_nirfaster.sh CPU
shell: bash

- name: Running Tests
run: |
python -m pytest --verbose
run: python -m pytest --verbose
Loading