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

on ubuntu and windows runners env.CONDA is null #349

Open
robandpdx opened this issue May 1, 2024 · 0 comments · May be fixed by #350
Open

on ubuntu and windows runners env.CONDA is null #349

robandpdx opened this issue May 1, 2024 · 0 comments · May be fixed by #350

Comments

@robandpdx
Copy link

robandpdx commented May 1, 2024

I am following the example for caching conda environments. My workflow file looks like this...

name: Conda cache test
on:
  pull_request:
  workflow_dispatch:
defaults:
  run:
    shell: bash -el {0}
jobs:
  conda:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup Miniconda
        uses: conda-incubator/setup-miniconda@v3.0.4
        with:
          python-version: '3.8'
          activate-environment: myenv
      - name: Get Date
        id: get-date
        run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
      - name: Cache Conda env
        uses: actions/cache@v3
        with:
          path: ${{ env.CONDA }}/envs
          key:
            conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}
        env:
          # Increase this value to reset cache if etc/example-environment.yml has not changed
          CACHE_NUMBER: 0
        id: cache

The logs show the following on an ubuntu-latest runner...

Run actions/cache@v3
  with:
    path: /envs
    key: conda-Linux--X64--[2](https://github.com/robandpdx/tools/actions/runs/8915174163/job/24484247942#step:5:2)0240501-0
    enableCrossOsArchive: false
    fail-on-cache-miss: false
    lookup-only: false
  env:
    INPUT_RUN_POST: true
    CONDA_PKGS_DIR: /home/runner/conda_pkgs_dir
    CACHE_NUMBER: 0
Cache not found for input keys: conda-Linux--X64--20240501-0

The logs show the following on a windows-latest runner...

Run actions/cache@v3
  with:
    path: /envs
    key: conda-Windows--X64--[2](https://github.com/robandpdx/tools/actions/runs/8915174163/job/24484248541#step:5:2)0240501-0
    enableCrossOsArchive: false
    fail-on-cache-miss: false
    lookup-only: false
  env:
    INPUT_RUN_POST: true
    CONDA_PKGS_DIR: C:\Users\runneradmin\conda_pkgs_dir
    CACHE_NUMBER: 0
Cache not found for input keys: conda-Windows--X64--20240501-0

However, on a macos-latest runner, the env.CONDA does resolve as expected...

Run actions/cache@v3
  with:
    path: /Users/runner/miniconda3/envs
    key: conda-macOS--ARM64--[2](https://github.com/robandpdx/tools/actions/runs/8915174163/job/24484248219#step:5:2)0240501-0
    enableCrossOsArchive: false
    fail-on-cache-miss: false
    lookup-only: false
  env:
    INPUT_RUN_POST: true
    CONDA: /Users/runner/miniconda[3](https://github.com/robandpdx/tools/actions/runs/8915174163/job/24484248219#step:5:3)
    CONDA_PKGS_DIR: /Users/runner/conda_pkgs_dir
    CACHE_NUMBER: 0
Cache not found for input keys: conda-macOS--ARM64--20240501-0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant