Skip to content

Commit

Permalink
try aml reader
Browse files Browse the repository at this point in the history
  • Loading branch information
lacava committed Jan 24, 2024
1 parent 50bffdf commit 34e450e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
37 changes: 24 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ jobs:
# echo "Didn't find the cache for the srbench environment :("
# conda info --envs
# mamba env update -n srbench -f environment.yml
test-yaml-reader:
runs-on: ubuntu-latest
name: Test read-yaml
list-algs:
runs-on: ubuntu-latest
outputs:
Expand Down Expand Up @@ -116,6 +119,17 @@ jobs:
################################################################################
# install the submission
################################################################################

-
name: Run read-yaml action
uses: actions/checkout@v3
id: yaml-data
uses: jbutcher5/read-yaml@main # You may wish to replace main with a version tag such as '1.6' etc.
with:
file: './algorithms/${{ matrix.alg }}/metadata.yml'
key-path: '["build", "clone_base_env"]' # Access the runs key then the using key and retuns the value.
- name: Display read-yaml output
run: echo "${{ steps.yaml-data.outputs.data }}"
-
name: Cache alg environment
id: cache-alg
Expand All @@ -124,25 +138,22 @@ jobs:
with:
path: /usr/share/miniconda3/envs/srbench-${{ matrix.alg }}
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles(format('./algorithms/{0}/**', matrix.alg)) }}
# TODO: read metadata for build process instructions /~https://github.com/marketplace/actions/read-yaml
-
name: Create alg environment
name: Create alg environment from srbench clone
if: |
steps.cache-alg.outputs.cache-hit != 'true'
run: |
echo "Installing dependencies for ${{ matrix.alg }}"
echo "Copying base environment"
if test -f "algorithms/${{ matrix.alg }}/environment.yml" ; then
mamba env create -n srbench-${{ matrix.alg }} -f base_environment.yml -f algorithms/${{ matrix.alg }}/environment.yml
else
mamba env create -n srbench-${{ matrix.alg }} -f base_environment.yml
fi
# -
# name: Update alg env from environment.yml
# if: |
# steps.cache-alg.outputs.cache-hit != 'true'
# && hashFiles(format('./algorithms/{0}/environment.yml', matrix.alg)) != ''
# run: |
# mamba env update -n srbench-${{ matrix.alg }} -f algorithms/${{ matrix.alg }}/environment.yml
mamba env create -n srbench-${{ matrix.alg }} --clone srbench
-
name: Update alg env from environment.yml
if: |
steps.cache-alg.outputs.cache-hit != 'true'
&& hashFiles(format('./algorithms/{0}/environment.yml', matrix.alg)) != ''
run: |
mamba env update -n srbench-${{ matrix.alg }} -f algorithms/${{ matrix.alg }}/environment.yml
-
name: Update alg env from requirements.txt
if: |
Expand Down
2 changes: 1 addition & 1 deletion algorithms/feat/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ url: http://cavalab.org/feat # a link to the project
# Option arguments for the build process.
# Unless you know what you are doing, do not change these.
build:
clone_base_env: yes #
clone_base_env: yes

0 comments on commit 34e450e

Please sign in to comment.