Include date in conda env grep to prevent miss on date-change

Currently the grep expression used to filter existing conda envs only
use ${{ env.conda-env-name-no-time }}, whereas the full env name
includes the date.  This results in false hits when jobs in a single
workflow runs across multiple dates.
This commit is contained in:
Hansung Kim
2024-01-26 00:06:04 -08:00
parent 3ba386d22b
commit eed69597ad

View File

@@ -5,8 +5,8 @@ runs:
steps: steps:
- name: Create conda environments - name: Create conda environments
run: | run: |
if conda env list | grep -q "envs/${{ env.conda-env-name-no-time }}"; then if conda env list | grep -q "envs/${{ env.conda-env-name-no-time }}-$(date --date \"${{ env.workflow-timestamp }}\" +%Y%m%d)"; then
echo "Using pre-existing conda environments with prefix ${{ env.conda-env-name-no-time }}" echo "Using pre-existing conda environments with prefix ${{ env.conda-env-name-no-time }}-$(date --date \"${{ env.workflow-timestamp }}\" +%Y%m%d)"
else else
echo "Creating a conda environment for each toolchain with the toolchain installed" echo "Creating a conda environment for each toolchain with the toolchain installed"
conda activate base conda activate base