1919 name : Pre-build checks
2020 runs-on : ubuntu-latest
2121 timeout-minutes : 15
22- env :
23- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
2422 steps :
2523 - name : Checkout repo
2624 uses : actions/checkout@v2
@@ -33,17 +31,21 @@ jobs:
3331 - name : Install helm
3432 uses : azure/setup-helm@v1.1
3533
36- - name : Fetch dependencies from cache
37- id : cache-yarn
38- uses : actions/cache@v2
39- with :
40- path : " **/node_modules"
41- key : yarn-build-${{ hashFiles('**/yarn.lock') }}
42- restore-keys : |
43- yarn-build-
34+ # NOTE@jsjoeio
35+ # disabling this until we can audit the build process
36+ # and the usefulness of this step
37+ # See: https://github.com/cdr/code-server/issues/4287
38+ # - name: Fetch dependencies from cache
39+ # id: cache-yarn
40+ # uses: actions/cache@v2
41+ # with:
42+ # path: "**/node_modules"
43+ # key: yarn-build-${{ hashFiles('**/yarn.lock') }}
44+ # restore-keys: |
45+ # yarn-build-
4446
4547 - name : Install dependencies
46- if : steps.cache-yarn.outputs.cache-hit != 'true'
48+ # if: steps.cache-yarn.outputs.cache-hit != 'true'
4749 run : yarn --frozen-lockfile
4850
4951 - name : Run yarn fmt
5456 run : yarn lint
5557 if : success()
5658
57- - name : Run code-server unit tests
58- run : yarn test:unit
59- if : success()
60-
61- - name : Upload coverage report to Codecov
62- run : yarn coverage
63- if : success()
64-
6559 audit-ci :
6660 name : Run audit-ci
6761 needs : prebuild
9892 needs : prebuild
9993 runs-on : ubuntu-latest
10094 timeout-minutes : 30
95+ env :
96+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
10197 steps :
10298 - uses : actions/checkout@v2
10399 with :
@@ -108,48 +104,63 @@ jobs:
108104 with :
109105 node-version : " 14"
110106
111- - name : Fetch dependencies from cache
112- id : cache-yarn
113- uses : actions/cache@v2
114- with :
115- path : " **/node_modules"
116- key : yarn-build-${{ hashFiles('**/yarn.lock') }}
117- restore-keys : |
118- yarn-build-
107+ # TODO@Teffen investigate why this omits code-oss-dev/node_modules
108+ # - name: Fetch dependencies from cache
109+ # id: cache-yarn
110+ # uses: actions/cache@v2
111+ # with:
112+ # path: |
113+ # "**/node_modules"
114+ # "**/vendor/modules"
115+ # "**/vendor/modules/code-oss-dev/node_modules"
116+ # key: yarn-build-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/vendor/yarn.lock') }}
117+ # restore-keys: |
118+ # yarn-build-
119119
120120 - name : Install dependencies
121- if : steps.cache-yarn.outputs.cache-hit != 'true'
121+ # if: steps.cache-yarn.outputs.cache-hit != 'true'
122122 run : yarn --frozen-lockfile
123123
124124 - name : Build code-server
125125 run : yarn build
126126
127- # Parse the hash of the latest commit inside lib/vscode
127+ # Parse the hash of the latest commit inside vendor/modules/code-oss-dev
128128 # use this to avoid rebuilding it if nothing changed
129129 # How it works: the `git log` command fetches the hash of the last commit
130- # that changed a file inside `lib/vscode `. If a commit changes any file in there,
130+ # that changed a file inside `vendor/modules/code-oss-dev `. If a commit changes any file in there,
131131 # the hash returned will change, and we rebuild vscode. If the hash did not change,
132132 # (for example, a change to `src/` or `docs/`), we reuse the same build as last time.
133133 # This saves a lot of time in CI, as compiling VSCode can take anywhere from 5-10 minutes.
134- - name : Get latest lib/vscode rev
134+ - name : Get latest vendor/modules/code-oss-dev rev
135135 id : vscode-rev
136- run : echo "::set-output name=rev::$(git log -1 --format='%H' ./lib/vscode )"
136+ run : echo "::set-output name=rev::$(jq -r '.devDependencies["code-oss-dev"]' vendor/package.json | sed -r 's|.*#(.*)$|\1|' )"
137137
138138 - name : Attempt to fetch vscode build from cache
139139 id : cache-vscode
140140 uses : actions/cache@v2
141141 with :
142142 path : |
143- lib/vscode /.build
144- lib/vscode /out-build
145- lib/vscode/ out-vscode
146- lib/vscode/ out-vscode-min
147- key : vscode-build-${{ steps.vscode-rev.outputs.rev }}
143+ vendor/modules/code-oss-dev /.build
144+ vendor/modules/code-oss-dev /out-build
145+ vendor/modules/code-oss-dev/ out-vscode-server
146+ vendor/modules/code-oss-dev/ out-vscode-server -min
147+ key : vscode-server- build-${{ steps.vscode-rev.outputs.rev }}
148148
149149 - name : Build vscode
150150 if : steps.cache-vscode.outputs.cache-hit != 'true'
151151 run : yarn build:vscode
152152
153+ # Our code imports code from VS Code's `out` directory meaning VS Code
154+ # must be built before running these tests.
155+ # TODO: Move to its own step?
156+ - name : Run code-server unit tests
157+ run : yarn test:unit
158+ if : success()
159+
160+ - name : Upload coverage report to Codecov
161+ run : yarn coverage
162+ if : success()
163+
153164 # The release package does not contain any native modules
154165 # and is neutral to architecture/os/libc version.
155166 - name : Create release package
@@ -240,10 +251,14 @@ jobs:
240251 # so we just build with "native"/x86_64 node, then download arm64/armv7l node
241252 # and then put it in our release. We can't smoke test the cross build this way,
242253 # but this means we don't need to maintain a self-hosted runner!
254+
255+ # NOTE@jsjoeio:
256+ # We used to use 16.04 until GitHub deprecated it on September 20, 2021
257+ # See here: https://github.com/actions/virtual-environments/pull/3862/files
243258 package-linux-cross :
244259 name : Linux cross-compile builds
245260 needs : build
246- runs-on : ubuntu-16 .04
261+ runs-on : ubuntu-18 .04
247262 timeout-minutes : 15
248263 strategy :
249264 matrix :
@@ -275,7 +290,7 @@ jobs:
275290 echo "$HOME/.local/bin" >> $GITHUB_PATH
276291
277292 - name : Install cross-compiler
278- run : sudo apt install $PACKAGE
293+ run : sudo apt update && sudo apt install $PACKAGE
279294 env :
280295 PACKAGE : ${{ format('g++-{0}', matrix.prefix) }}
281296
@@ -420,7 +435,7 @@ jobs:
420435 uses : actions/checkout@v2
421436 - name : Run Trivy vulnerability scanner in repo mode
422437 # Commit SHA for v0.0.17
423- uses : aquasecurity/trivy-action@8eccb5539730451af599c84f444c6d6cf0fc2bb0
438+ uses : aquasecurity/trivy-action@1ccef265f594a7555a720f623a461a3d69b45bf7
424439 with :
425440 scan-type : " fs"
426441 scan-ref : " ."
0 commit comments