Skip to content

Commit af739fe

Browse files
authored
fix(mac/lfortran): only install micromamba if needed (#79)
1 parent b4cbf37 commit af739fe

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

action.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,20 @@ runs:
4242
path: ${{ env.ONEAPI_ROOT }}
4343
key: ${{ runner.os }}-${{ inputs.compiler }}-${{ inputs.version }}-${{ steps.get-date.outputs.date }}
4444

45-
# used to install lfortran on mac
46-
- uses: mamba-org/setup-micromamba@v1
45+
# Use micromamba for lfortran install on mac. Check if micromamba already
46+
# exists, only install it if needed. If we install it, clean it up after.
47+
- name: Check for micromamba
48+
id: check-umamba
4749
if: runner.os == 'macOS' && contains(inputs.compiler, 'lfortran')
50+
shell: bash
51+
run: |
52+
if [ "$(command -v micromamba)" ]; then
53+
echo "install=false" >> $GITHUB_OUTPUT
54+
else
55+
echo "install=true" >> $GITHUB_OUTPUT
56+
fi
57+
- uses: mamba-org/setup-micromamba@v1
58+
if: runner.os == 'macOS' && contains(inputs.compiler, 'lfortran') && steps.check-umamba.outputs.install == 'true'
4859
with:
4960
init-shell: bash
5061
post-cleanup: 'all'

0 commit comments

Comments
 (0)