1
1
name : ci
2
2
3
- on : [push]
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ pull_request :
8
+ branches :
9
+ - main
4
10
5
11
jobs :
6
12
fmt :
7
13
runs-on : ubuntu-latest
8
14
steps :
9
- - uses : actions/checkout@v1
15
+ - uses : actions/checkout@v2
10
16
- name : Run ./ci/steps/fmt.sh
11
17
uses : ./ci/images/debian10
12
18
with :
@@ -15,20 +21,28 @@ jobs:
15
21
lint :
16
22
runs-on : ubuntu-latest
17
23
steps :
18
- - uses : actions/checkout@v1
24
+ - uses : actions/checkout@v2
19
25
- name : Run ./ci/steps/lint.sh
20
26
uses : ./ci/images/debian10
21
27
with :
22
28
args : ./ci/steps/lint.sh
23
29
24
- test :
30
+ test-unit :
31
+ runs-on : ubuntu-latest
32
+ steps :
33
+ - uses : actions/checkout@v1
34
+ - name : Run unit tests
35
+ uses : ./ci/images/debian10
36
+ with :
37
+ args : ./ci/steps/test-unit.sh
38
+ test-e2e :
25
39
needs : linux-amd64
26
40
runs-on : ubuntu-latest
27
41
env :
28
42
PASSWORD : e45432jklfdsab
29
43
CODE_SERVER_ADDRESS : http://localhost:8080
30
44
steps :
31
- - uses : actions/checkout@v1
45
+ - uses : actions/checkout@v2
32
46
- name : Download release packages
33
47
uses : actions/download-artifact@v2
34
48
with :
@@ -38,24 +52,24 @@ jobs:
38
52
run : |
39
53
cd release-packages && tar -xzf code-server*-linux-amd64.tar.gz
40
54
- uses : microsoft/playwright-github-action@v1
41
- - name : Install dependencies and run tests
55
+ - name : Install dependencies and run end-to-end tests
42
56
run : |
43
57
./release-packages/code-server*-linux-amd64/bin/code-server &
44
58
yarn --frozen-lockfile
45
- yarn test
59
+ yarn test:e2e
46
60
- name : Upload test artifacts
47
61
if : always()
48
62
uses : actions/upload-artifact@v2
49
63
with :
50
64
name : test-videos
51
- path : ./test/videos
65
+ path : ./test/e2e/ videos
52
66
- name : Remove release packages and test artifacts
53
- run : rm -rf ./release-packages ./test/videos
67
+ run : rm -rf ./release-packages ./test/e2e/ videos
54
68
55
69
release :
56
70
runs-on : ubuntu-latest
57
71
steps :
58
- - uses : actions/checkout@v1
72
+ - uses : actions/checkout@v2
59
73
- name : Run ./ci/steps/release.sh
60
74
uses : ./ci/images/debian10
61
75
with :
70
84
needs : release
71
85
runs-on : ubuntu-latest
72
86
steps :
73
- - uses : actions/checkout@v1
87
+ - uses : actions/checkout@v2
74
88
- name : Download npm package
75
89
uses : actions/download-artifact@v2
76
90
with :
90
104
needs : release
91
105
runs-on : ubuntu-arm64-latest
92
106
steps :
93
- - uses : actions/checkout@v1
107
+ - uses : actions/checkout@v2
94
108
- name : Download npm package
95
109
uses : actions/download-artifact@v2
96
110
with :
@@ -111,8 +125,10 @@ jobs:
111
125
macos-amd64 :
112
126
needs : release
113
127
runs-on : macos-latest
128
+ # This job requires secrets, so can only run on the default branch
129
+ if : github.ref == 'refs/heads/main'
114
130
steps :
115
- - uses : actions/checkout@v1
131
+ - uses : actions/checkout@v2
116
132
- name : Download npm package
117
133
uses : actions/download-artifact@v2
118
134
with :
@@ -133,7 +149,7 @@ jobs:
133
149
runs-on : ubuntu-latest
134
150
needs : linux-amd64
135
151
steps :
136
- - uses : actions/checkout@v1
152
+ - uses : actions/checkout@v2
137
153
- name : Download release package
138
154
uses : actions/download-artifact@v2
139
155
with :
@@ -153,7 +169,7 @@ jobs:
153
169
runs-on : ubuntu-arm64-latest
154
170
needs : linux-arm64
155
171
steps :
156
- - uses : actions/checkout@v1
172
+ - uses : actions/checkout@v2
157
173
- name : Download release package
158
174
uses : actions/download-artifact@v2
159
175
with :
0 commit comments