Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit b891110

Browse files
committed
Add install script test
1 parent 023defa commit b891110

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

.github/workflows/test.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,8 @@ jobs:
5353
uses: ./ci/image
5454
with:
5555
args: ./ci/steps/gendocs.sh
56+
install-test:
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v1
60+
- run: ./ci/steps/install_test.sh

ci/steps/install_test.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh
2+
# forked from https://github.com/denoland/deno_install/blob/master/install_test.sh
3+
4+
set -e
5+
6+
cd "$(dirname "$0")"
7+
cd ../../
8+
9+
# Lint.
10+
shellcheck -s sh ./*.sh
11+
12+
# Test that we can install the latest version at the default location.
13+
rm -f ~/.coder/bin/coder
14+
unset CODER_INSTALL
15+
sh ./install.sh
16+
~/.coder/bin/coder --version
17+
18+
# Test that we can install a specific version at a custom location.
19+
rm -rf ~/coder-1.12.2
20+
export CODER_INSTALL="$HOME/coder-1.12.2"
21+
./install.sh v1.12.2
22+
~/coder-1.12.2/bin/coder --version | grep 1.12.2
23+
24+
# Test that we can install at a relative custom location.
25+
export CODER_INSTALL="."
26+
./install.sh v1.12.2
27+
bin/coder --version | grep 1.12.2

ci/steps/lint.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
set -euo pipefail
44

5-
echo "Linting..."
6-
75
cd "$(dirname "$0")"
86
cd ../../
97

install.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/sh
2+
# coder-cli installation helper script
3+
# fork of https://github.com/denoland/deno_install
24
# TODO(everyone): Keep this script simple and easily auditable.
35

46
set -e
@@ -28,7 +30,7 @@ else
2830
fi
2931

3032
version=${1:-""}
31-
if [ "$version" == "" ]; then
33+
if [ "$version" = "" ]; then
3234
coder_asset_path=$(
3335
curl -sSf https://github.com/cdr/coder-cli/releases |
3436
grep -o "/cdr/coder-cli/releases/download/.*/coder-cli-${target}${extension}" |

0 commit comments

Comments
 (0)