File tree Expand file tree Collapse file tree 9 files changed +420
-135
lines changed Expand file tree Collapse file tree 9 files changed +420
-135
lines changed Original file line number Diff line number Diff line change 1
- name : ci
1
+ name : Build
2
2
3
3
on :
4
4
push :
16
16
17
17
jobs :
18
18
prebuild :
19
- name : Pre-Build checks
19
+ name : Pre-build checks
20
20
runs-on : ubuntu-latest
21
21
timeout-minutes : 5
22
22
env :
Original file line number Diff line number Diff line change
1
+ name : Installer integration
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
+ alpine :
28
+ name : Test installer on Alpine
29
+ runs-on : ubuntu-latest
30
+ container : " alpine:3.14"
31
+ steps :
32
+ - name : Checkout repo
33
+ uses : actions/checkout@v2
34
+
35
+ - name : Install curl
36
+ run : apk add curl
37
+
38
+ - name : Add user
39
+ run : adduser coder --disabled-password
40
+
41
+ # Standalone should work without root.
42
+ - name : Test standalone to a non-existent prefix
43
+ run : su coder -c "./install.sh --method standalone --prefix /tmp/does/not/yet/exist"
44
+
45
+ macos :
46
+ name : Test installer on macOS
47
+ runs-on : macos-latest
48
+
49
+ steps :
50
+ - name : Checkout repo
51
+ uses : actions/checkout@v2
52
+
53
+ - name : Install code-server
54
+ run : ./install.sh
55
+
56
+ - name : Test code-server
57
+ run : yarn test:standalone-release code-server
Original file line number Diff line number Diff line change
1
+ name : Script unit tests
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
+ test :
15
+ name : Run script unit tests
16
+ runs-on : ubuntu-latest
17
+ # This runs on Alpine to make sure we're testing with actual sh.
18
+ container : " alpine:3.14"
19
+ steps :
20
+ - name : Checkout repo
21
+ uses : actions/checkout@v2
22
+
23
+ - name : Install test utilities
24
+ run : apk add bats checkbashisms
25
+
26
+ - name : Check Bashisms
27
+ run : checkbashisms ./install.sh
28
+
29
+ - name : Run script unit tests
30
+ run : ./ci/dev/test-scripts.sh
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
set -euo pipefail
3
3
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
+ #
5
7
# This is to make sure we don't have Node version errors or any other
6
8
# compilation-related errors.
7
9
main () {
@@ -10,12 +12,14 @@ main() {
10
12
local EXTENSIONS_DIR
11
13
EXTENSIONS_DIR=" $( mktemp -d) "
12
14
13
- echo " Testing standalone release. "
15
+ local path= ${1 :- . / release-standalone / bin / code-server}
14
16
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
17
21
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 ) "
19
23
# We use grep as wesbos.theme-cobalt2 may have dependency extensions that change.
20
24
if ! echo " $installed_extensions " | grep -q " wesbos.theme-cobalt2" ; then
21
25
echo " Unexpected output from listing extensions:"
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ main () {
5
+ cd " $( dirname " $0 " ) /../.."
6
+ bats ./test/scripts
7
+ }
8
+
9
+ main " $@ "
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ Here is what is needed:
44
44
- Get this by running ` apt-get install -y build-essential `
45
45
- ` rsync ` and ` unzip `
46
46
- Used for code-server releases
47
+ - ` bats `
48
+ - Used to run script unit tests
47
49
48
50
## Creating pull requests
49
51
You can’t perform that action at this time.
0 commit comments