Skip to content

Commit 0e357ea

Browse files
authored
test (#28)
1 parent 5129405 commit 0e357ea

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

.github/workflows/test-install.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
shell: bash
3636
env:
3737
DEVA_INSTALL_VERSION: latest
38+
DEVA_INSTALL_FEATURES: legacy-tasks
3839

3940
- name: Verify
4041
run: deva --version

action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ inputs:
88
version:
99
description: The version of deva to install
1010
default: latest
11+
features:
12+
description: Space-separated list of features to install
13+
default: ""
1114

1215
runs:
1316
using: composite
@@ -17,5 +20,5 @@ runs:
1720
run: "'${{ github.action_path }}${{ runner.os == 'Windows' && '\\' || '/' }}main.sh'"
1821
shell: bash
1922
env:
20-
DEVA_INSTALL_VERSION: ${{ inputs.version }}
21-
DEVA_INSTALL_FEATURES: legacy-tasks
23+
DEVA_INSTALL_VERSION: "${{ inputs.version }}"
24+
DEVA_INSTALL_FEATURES: "${{ inputs.features }}"

main.sh

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ else
2323
fi
2424
INSTALL_PATH="${DEVA_INSTALL_PATH:-${RUNNER_TOOL_CACHE}${SEP}.deva}"
2525

26+
install_features() {
27+
if [[ -n "${FEATURES}" ]]; then
28+
echo -e "${PURPLE}Installing features: ${FEATURES}${RESET}"
29+
30+
ARGS=()
31+
for feature in $FEATURES; do
32+
ARGS+=("-f" "$feature")
33+
done
34+
35+
"${1}" -v self dep sync "${ARGS[@]}"
36+
fi
37+
}
38+
2639
install_deva() {
2740
mkdir -p "${INSTALL_PATH}"
2841
archive="${INSTALL_PATH}${SEP}$1"
@@ -46,8 +59,10 @@ install_deva() {
4659
rm "${archive}"
4760

4861
echo -e "${PURPLE}Installing deva ${DEVA_INSTALL_VERSION}${RESET}"
49-
"${INSTALL_PATH}${SEP}deva" --version
50-
"${INSTALL_PATH}${SEP}deva" self cache dist --remove
62+
deva_path="${INSTALL_PATH}${SEP}deva"
63+
"$deva_path" --version
64+
"$deva_path" self cache dist --remove
65+
install_features "$deva_path"
5166

5267
if [[ "${GITHUB_ACTIONS:-}" == "true" ]]; then
5368
echo "${INSTALL_PATH}" >> "${GITHUB_PATH}"
@@ -63,6 +78,7 @@ fallback_install_deva() {
6378
fi
6479

6580
deva --version
81+
install_features deva
6682
}
6783

6884
if [[ "${TARGET_PLATFORM}" == "linux" ]]; then
@@ -80,7 +96,7 @@ elif [[ "${TARGET_PLATFORM}" == "windows" ]]; then
8096
fallback_install_deva
8197
fi
8298
elif [[ "${TARGET_PLATFORM}" == "macos" ]]; then
83-
if [[ "${TARGET_ARCH}" == "ARM64" ]]; then
99+
if [[ "${TARGET_ARCH}" == "arm64" ]]; then
84100
install_deva "deva-aarch64-apple-darwin.tar.gz"
85101
elif [[ "${TARGET_ARCH}" == "x64" ]]; then
86102
install_deva "deva-x86_64-apple-darwin.tar.gz"
@@ -90,14 +106,3 @@ elif [[ "${TARGET_PLATFORM}" == "macos" ]]; then
90106
else
91107
fallback_install_deva
92108
fi
93-
94-
if [[ -n "${FEATURES}" ]]; then
95-
echo -e "${PURPLE}Installing features: ${FEATURES}${RESET}"
96-
97-
ARGS=()
98-
for feature in $FEATURES; do
99-
ARGS+=("-f" "$feature")
100-
done
101-
102-
deva dep sync "${ARGS[@]}"
103-
fi

0 commit comments

Comments
 (0)