-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathaction.yml
88 lines (80 loc) · 2.75 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
name: 'Setup Nim environment'
description: 'Setup a Nim environment and add it to the PATH'
author: 'jiro4989'
inputs:
nim-version:
description: >-
The Nim version to download (if necessary)
and use. Example 1.0.2
default: 'stable'
nim-install-directory:
description: >-
The Nim compiler installation directory.
default: '.nim_runtime'
parent-nim-install-directory:
description: >-
The Nim compiler installation parent directory.
It will be placed in the current directory if this parameter is empty.
default: ''
use-nightlies:
description: >-
Using nightlies build (https://github.com/nim-lang/nightlies/releases) if `nim-version` is `devel`.
The installation will be fast if this parameter is `true`.
If `nim-version` is not `devel`, then this parameter has no effect.
default: false
repo-token:
description: 'The GITHUB_TOKEN secret'
required: false
# NOTE: Unused parameters. These parameters were used in setup-nim-action@v1.
# setup-nim-action@v2 does not require these. These are left for backward compatibility.
no-color:
description: '[Deprecated] unused parameter'
default: false
"yes":
description: '[Deprecated] unused parameter'
default: false
runs:
using: 'composite'
steps:
- name: Install nim
shell: bash
run: |
"${{ github.action_path }}/install_nim.sh" \
--nim-version "${{ inputs.nim-version }}" \
--parent-nim-install-directory "${{ inputs.parent-nim-install-directory }}" \
--nim-install-directory "${{ inputs.nim-install-directory }}" \
--os "${{ runner.os }}" \
--use-nightlies "${{ inputs.use-nightlies }}" \
--repo-token "${{ inputs.repo-token }}"
- name: Set PATH for Unix
shell: bash
run: |
parent="${{ inputs.parent-nim-install-directory }}"
if [[ "${parent}" = "" ]]; then
parent="$PWD"
fi
echo "$parent/${{ inputs.nim-install-directory }}/bin" >> "$GITHUB_PATH"
echo "$HOME/.nimble/bin" >> "$GITHUB_PATH"
if: runner.os != 'Windows'
- name: Set PATH for Windows
shell: pwsh
run: |
$parent = "${{ inputs.parent-nim-install-directory }}"
if ($parent -eq "") {
$parent = "$Pwd"
}
echo "$parent\${{ inputs.nim-install-directory }}\bin" >> $Env:GITHUB_PATH
mkdir -Force ~\.nimble\bin
(Resolve-Path ~\.nimble\bin).Path >> $Env:GITHUB_PATH
if: runner.os == 'Windows'
- name: Print nim directory
shell: bash
run: |
echo "installed nim fullpath: $(which nim)"
- name: Print nim version
shell: bash
run: nim -v
- name: Print nimble version
shell: bash
run: nimble -v