generated from wenkokke/example-haskell-wheel
-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
66 lines (61 loc) · 2.2 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: setup-agda
description: "Installs Agda on the current runner"
inputs:
agda-version:
description: "The version of Agda to install, defaults to latest"
required: false
default: ""
update-environment:
description: "Set this option if you want the action to update environment variables."
required: false
default: "true"
outputs:
agda-path:
description: "The path to the agda executable"
value: ${{ steps.setup-agda.outputs.agda-path }}
agda-mode-path:
description: "The path to the agda-mode executable"
value: ${{ steps.setup-agda.outputs.agda-mode-path }}
agda-data-path:
description: "The path to the agda data directory"
value: ${{ steps.setup-agda.outputs.agda-data-path }}
branding:
icon: feather
color: gray-dark
runs:
using: composite
steps:
- # Set up a non-EOL & pipx supported Python version
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.8 - 3.12"
update-environment: false
- # Install Agda
id: setup-agda
run: |
PYTHON='${{ steps.setup-python.outputs.python-path }}'
# Ensure pipx is available
if ! type "pipx" > /dev/null; then
"${PYTHON}" -m pip install pipx
fi
# Install agda
LOWER_BOUND='${{ inputs.agda-version }}'
if [ "${LOWER_BOUND}" = '' ]; then
"${PYTHON}" -m pipx install --python "${PYTHON}" agda
else
UPPER_BOUND=$("${PYTHON}" -c "v='${LOWER_BOUND}'.split('.');print('.'.join([*v[:-1],str(int(v[-1])+1)]))")
"${PYTHON}" -m pipx install --python "${PYTHON}" "agda >=${LOWER_BOUND}, <${UPPER_BOUND}"
fi
# Set output variables
echo "agda-path=${PIPX_BIN_DIR}/agda" >> $GITHUB_OUTPUT
echo "agda-mode-path=${PIPX_BIN_DIR}/agda-mode" >> $GITHUB_OUTPUT
echo "agda-data-path=$("${PIPX_BIN_DIR}/agda" --print-agda-dir)" >> $GITHUB_OUTPUT
shell: bash
env:
# Set PIPX_BIN_DIR for a consistent install location
PIPX_BIN_DIR: "${{ env.HOME }}/.agda/bin"
- # Update environment
if: ${{ inputs.update-environment }} == 'true'
run: echo "${{ env.HOME }}/.agda/bin" >> $GITHUB_PATH
shell: bash