Skip to content

Commit db9f060

Browse files
committed
Add CI workflow for testing installer
1 parent f8a1a1c commit db9f060

File tree

2 files changed

+48
-5
lines changed

2 files changed

+48
-5
lines changed

.github/workflows/installer.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: installer
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "installer.sh"
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
ubuntu:
15+
name: Test installer on ubuntu
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repo
19+
uses: actions/checkout@v2
20+
21+
- name: Install code-server
22+
run: ./install.sh
23+
24+
- name: Test code-server
25+
run: yarn test:standalone-release code-server
26+
27+
macos:
28+
name: Test installer on macOS
29+
runs-on: macos-latest
30+
31+
steps:
32+
- name: Checkout repo
33+
uses: actions/checkout@v2
34+
35+
- name: Install code-server
36+
run: ./install.sh
37+
38+
- name: Test code-server
39+
run: yarn test:standalone-release code-server

ci/build/test-standalone-release.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
# Makes sure the release works.
4+
# Make sure a code-server release works. You can pass in the path otherwise it
5+
# will use release-standalone in the current directory.
6+
#
57
# This is to make sure we don't have Node version errors or any other
68
# compilation-related errors.
79
main() {
@@ -10,12 +12,14 @@ main() {
1012
local EXTENSIONS_DIR
1113
EXTENSIONS_DIR="$(mktemp -d)"
1214

13-
echo "Testing standalone release."
15+
local path=${1:-./release-standalone/bin/code-server}
1416

15-
# Note: using a basic theme extension because it doesn't update often and is more reliable for testing
16-
./release-standalone/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --install-extension wesbos.theme-cobalt2
17+
echo "Testing standalone release in $path."
18+
19+
# NOTE: using a basic theme extension because it doesn't update often and is more reliable for testing
20+
"$path" --extensions-dir "$EXTENSIONS_DIR" --install-extension wesbos.theme-cobalt2
1721
local installed_extensions
18-
installed_extensions="$(./release-standalone/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --list-extensions 2>&1)"
22+
installed_extensions="$("$path" --extensions-dir "$EXTENSIONS_DIR" --list-extensions 2>&1)"
1923
# We use grep as wesbos.theme-cobalt2 may have dependency extensions that change.
2024
if ! echo "$installed_extensions" | grep -q "wesbos.theme-cobalt2"; then
2125
echo "Unexpected output from listing extensions:"

0 commit comments

Comments
 (0)