Skip to content

Commit

Permalink
Fix mambaforge issue in STARDIS tests (#2839)
Browse files Browse the repository at this point in the history
Fix the mambaforge issue by changing action
  • Loading branch information
atharva-2001 authored Oct 7, 2024
1 parent 3a391ae commit 4341331
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions .github/workflows/stardis-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ on:
push:
branches:
- master

pull_request:
branches:
- '*'

- master
types:
- opened
- reopened
Expand Down Expand Up @@ -41,26 +39,25 @@ jobs:
with:
repository: tardis-sn/stardis

- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: stardis
use-mamba: true

- name: Cache lockfile
uses: actions/cache@v4
- name: Download Lock File
run: wget -q https://raw.githubusercontent.com/tardis-sn/stardis/main/conda-${{ matrix.label }}.lock
shell: bash

- name: Generate Cache Key
run: |
file_hash=$(cat conda-${{ matrix.label }}.lock | shasum -a 256 | cut -d' ' -f1)
echo "file_hash=$file_hash" >> "${GITHUB_OUTPUT}"
id: cache-environment-key
shell: bash

- uses: mamba-org/setup-micromamba@v1
with:
path: ${{ matrix.prefix }}
key: conda-${{ matrix.label }}-${{ hashFiles(format('conda-{0}.lock', matrix.label)) }}-${{ env.CACHE_NUMBER }}
id: cache-conda

- name: Update Conda Environment
id: update-env
run: |
mamba update -n stardis --file conda-${{ matrix.label }}.lock
if: steps.cache-conda.outputs.cache-hit != 'true'
environment-file: conda-${{ matrix.label }}.lock
cache-environment-key: ${{ steps.cache-environment-key.outputs.file_hash }}
cache-downloads-key: ${{ steps.cache-environment-key.outputs.file_hash }}
environment-name: stardis
cache-environment: true
cache-downloads: true

- name: Install tardis
id: install-tardis
Expand Down

0 comments on commit 4341331

Please sign in to comment.