2021-07-02 20:18:37 +02:00
|
|
|
name: Build
|
2020-05-07 06:06:55 +02:00
|
|
|
|
2021-03-12 18:48:39 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
2020-05-07 06:06:55 +02:00
|
|
|
|
2022-03-02 00:03:39 +01:00
|
|
|
# Cancel in-progress runs for pull requests when developers push
|
|
|
|
# additional changes, and serialize builds in branches.
|
|
|
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
|
2021-04-08 20:12:01 +02:00
|
|
|
# Note: if: success() is used in several jobs -
|
|
|
|
# this ensures that it only executes if all previous jobs succeeded.
|
|
|
|
|
2022-09-19 18:56:34 +02:00
|
|
|
# if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
2021-04-08 20:12:01 +02:00
|
|
|
# will skip running `yarn install` if it successfully fetched from cache
|
|
|
|
|
2020-05-07 06:06:55 +02:00
|
|
|
jobs:
|
2022-10-14 00:16:55 +02:00
|
|
|
prettier:
|
2022-09-22 21:33:32 +02:00
|
|
|
name: Format with Prettier
|
2022-12-06 21:28:27 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2022-09-22 21:33:32 +02:00
|
|
|
timeout-minutes: 5
|
2020-05-13 01:33:34 +02:00
|
|
|
steps:
|
2021-04-08 20:12:01 +02:00
|
|
|
- name: Checkout repo
|
2023-10-05 01:50:11 +02:00
|
|
|
uses: actions/checkout@v4
|
2021-04-08 20:12:01 +02:00
|
|
|
|
2022-10-14 00:16:55 +02:00
|
|
|
- name: Run prettier with actionsx/prettier
|
2023-09-22 02:13:34 +02:00
|
|
|
uses: actionsx/prettier@v3
|
2022-10-14 00:16:55 +02:00
|
|
|
with:
|
|
|
|
args: --check --loglevel=warn .
|
|
|
|
|
|
|
|
doctoc:
|
|
|
|
name: Doctoc markdown files
|
2022-12-06 21:28:27 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2022-10-14 00:16:55 +02:00
|
|
|
timeout-minutes: 5
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2023-10-05 01:50:11 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-10-14 00:16:55 +02:00
|
|
|
|
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2024-02-02 02:37:09 +01:00
|
|
|
uses: tj-actions/changed-files@v42
|
2022-10-14 00:16:55 +02:00
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
docs/**
|
|
|
|
|
2023-11-14 22:45:56 +01:00
|
|
|
- name: Install Node.js
|
2022-10-14 00:16:55 +02:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-11-14 19:23:05 +01:00
|
|
|
uses: actions/setup-node@v4
|
2020-05-13 01:33:34 +02:00
|
|
|
with:
|
2023-11-14 22:45:56 +01:00
|
|
|
node-version-file: .node-version
|
2022-10-14 00:16:55 +02:00
|
|
|
cache: "yarn"
|
2020-05-13 01:33:34 +02:00
|
|
|
|
2022-10-14 00:16:55 +02:00
|
|
|
- name: Install doctoc
|
2022-10-15 00:59:21 +02:00
|
|
|
run: yarn global add doctoc@2.2.1
|
2022-09-22 21:33:32 +02:00
|
|
|
|
2022-10-14 00:16:55 +02:00
|
|
|
- name: Run doctoc
|
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
|
|
|
run: yarn doctoc
|
2022-09-22 21:33:32 +02:00
|
|
|
|
|
|
|
lint-helm:
|
|
|
|
name: Lint Helm chart
|
2022-12-06 21:28:27 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2022-09-22 21:33:32 +02:00
|
|
|
timeout-minutes: 5
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2023-10-05 01:50:11 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-09-22 21:33:32 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
|
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2024-02-02 02:37:09 +01:00
|
|
|
uses: tj-actions/changed-files@v42
|
2022-09-22 21:33:32 +02:00
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
ci/helm-chart/**
|
|
|
|
|
2021-04-08 20:12:01 +02:00
|
|
|
- name: Install helm
|
2022-09-22 21:33:32 +02:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-01-03 18:28:58 +01:00
|
|
|
uses: azure/setup-helm@v3.5
|
2022-09-19 18:56:34 +02:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Install helm kubeval plugin
|
2022-09-22 21:33:32 +02:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2022-09-19 18:56:34 +02:00
|
|
|
run: helm plugin install https://github.com/instrumenta/helm-kubeval
|
2021-04-08 20:12:01 +02:00
|
|
|
|
2022-09-22 21:33:32 +02:00
|
|
|
- name: Lint Helm chart
|
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
|
|
|
run: helm kubeval ci/helm-chart
|
|
|
|
|
|
|
|
lint-ts:
|
|
|
|
name: Lint TypeScript files
|
2022-12-06 21:28:27 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2022-09-22 21:33:32 +02:00
|
|
|
timeout-minutes: 5
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2023-10-05 01:50:11 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-09-22 21:33:32 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
|
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2024-02-02 02:37:09 +01:00
|
|
|
uses: tj-actions/changed-files@v42
|
2022-09-22 21:33:32 +02:00
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
**/*.ts
|
|
|
|
**/*.js
|
|
|
|
files_ignore: |
|
|
|
|
lib/vscode/**
|
|
|
|
|
2023-11-14 22:45:56 +01:00
|
|
|
- name: Install Node.js
|
2022-09-22 21:33:32 +02:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-11-14 19:23:05 +01:00
|
|
|
uses: actions/setup-node@v4
|
2022-09-22 21:33:32 +02:00
|
|
|
with:
|
2023-11-14 22:45:56 +01:00
|
|
|
node-version-file: .node-version
|
2022-09-22 21:33:32 +02:00
|
|
|
|
2022-03-15 03:37:29 +01:00
|
|
|
- name: Fetch dependencies from cache
|
2022-09-22 21:33:32 +02:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2022-09-19 18:56:34 +02:00
|
|
|
id: cache-node-modules
|
2024-02-02 02:38:25 +01:00
|
|
|
uses: actions/cache@v4
|
2022-03-15 03:37:29 +01:00
|
|
|
with:
|
|
|
|
path: "**/node_modules"
|
|
|
|
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
yarn-build-
|
2021-04-08 20:12:01 +02:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2022-09-22 21:33:32 +02:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true' && steps.cache-node-modules.outputs.cache-hit != 'true'
|
2022-09-19 18:56:34 +02:00
|
|
|
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
2020-05-13 01:33:34 +02:00
|
|
|
|
2022-09-22 21:33:32 +02:00
|
|
|
- name: Lint TypeScript files
|
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
|
|
|
run: yarn lint:ts
|
2021-04-08 20:12:01 +02:00
|
|
|
|
2023-01-13 18:21:56 +01:00
|
|
|
lint-actions:
|
|
|
|
name: Lint GitHub Actions
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2023-10-05 01:50:11 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-01-13 18:21:56 +01:00
|
|
|
- name: Check workflow files
|
|
|
|
run: |
|
|
|
|
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/7fdc9630cc360ea1a469eed64ac6d78caeda1234/scripts/download-actionlint.bash)
|
|
|
|
./actionlint -color -shellcheck= -ignore "set-output"
|
|
|
|
shell: bash
|
|
|
|
|
2022-12-22 18:25:28 +01:00
|
|
|
test-unit:
|
|
|
|
name: Run unit tests
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
timeout-minutes: 5
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2023-10-05 01:50:11 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-12-22 18:25:28 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
|
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2024-02-02 02:37:09 +01:00
|
|
|
uses: tj-actions/changed-files@v42
|
2022-12-22 18:25:28 +01:00
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
**/*.ts
|
|
|
|
files_ignore: |
|
|
|
|
lib/vscode/**
|
|
|
|
|
2023-11-14 22:45:56 +01:00
|
|
|
- name: Install Node.js
|
2022-12-22 18:25:28 +01:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-11-14 19:23:05 +01:00
|
|
|
uses: actions/setup-node@v4
|
2022-12-22 18:25:28 +01:00
|
|
|
with:
|
2023-11-14 22:45:56 +01:00
|
|
|
node-version-file: .node-version
|
2022-12-22 18:25:28 +01:00
|
|
|
|
|
|
|
- name: Fetch dependencies from cache
|
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
|
|
|
id: cache-node-modules
|
2024-02-02 02:38:25 +01:00
|
|
|
uses: actions/cache@v4
|
2022-12-22 18:25:28 +01:00
|
|
|
with:
|
|
|
|
path: "**/node_modules"
|
|
|
|
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
yarn-build-
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
if: steps.changed-files.outputs.any_changed == 'true' && steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
|
|
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
|
|
|
|
|
|
|
- name: Run unit tests
|
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
|
|
|
run: yarn test:unit
|
|
|
|
|
|
|
|
- name: Upload coverage report to Codecov
|
2024-03-07 20:15:42 +01:00
|
|
|
uses: codecov/codecov-action@v4
|
2022-12-22 18:25:28 +01:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
if: success()
|
|
|
|
|
2021-04-08 20:12:01 +02:00
|
|
|
build:
|
2022-09-27 20:46:37 +02:00
|
|
|
name: Build code-server
|
2022-12-06 21:28:27 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2023-07-20 00:00:31 +02:00
|
|
|
timeout-minutes: 60
|
2021-10-28 22:27:17 +02:00
|
|
|
env:
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
2020-05-07 06:06:55 +02:00
|
|
|
steps:
|
2022-03-15 03:37:29 +01:00
|
|
|
- name: Checkout repo
|
2023-10-05 01:50:11 +02:00
|
|
|
uses: actions/checkout@v4
|
2020-05-08 02:44:32 +02:00
|
|
|
with:
|
2022-03-15 03:37:29 +01:00
|
|
|
submodules: true
|
2021-04-08 20:12:01 +02:00
|
|
|
|
2023-09-21 01:33:28 +02:00
|
|
|
- name: Install system dependencies
|
|
|
|
run: sudo apt update && sudo apt install -y libkrb5-dev
|
|
|
|
|
2022-03-22 21:07:14 +01:00
|
|
|
- name: Install quilt
|
2022-09-19 18:56:34 +02:00
|
|
|
uses: awalsh128/cache-apt-pkgs-action@latest
|
|
|
|
with:
|
|
|
|
packages: quilt
|
|
|
|
version: 1.0
|
2022-03-22 21:07:14 +01:00
|
|
|
|
|
|
|
- name: Patch Code
|
|
|
|
run: quilt push -a
|
|
|
|
|
2023-11-14 22:45:56 +01:00
|
|
|
- name: Install Node.js
|
2023-11-14 19:23:05 +01:00
|
|
|
uses: actions/setup-node@v4
|
2021-02-02 22:29:02 +01:00
|
|
|
with:
|
2023-11-14 22:45:56 +01:00
|
|
|
node-version-file: .node-version
|
2020-05-08 02:44:32 +02:00
|
|
|
|
2022-03-15 03:37:29 +01:00
|
|
|
- name: Fetch dependencies from cache
|
2022-09-19 18:56:34 +02:00
|
|
|
id: cache-node-modules
|
2024-02-02 02:38:25 +01:00
|
|
|
uses: actions/cache@v4
|
2022-03-15 03:37:29 +01:00
|
|
|
with:
|
|
|
|
path: "**/node_modules"
|
2022-12-22 18:25:28 +01:00
|
|
|
key: yarn-build-code-server-${{ hashFiles('**/yarn.lock') }}
|
2022-03-15 03:37:29 +01:00
|
|
|
restore-keys: |
|
2022-12-22 18:25:28 +01:00
|
|
|
yarn-build-code-server-
|
2021-04-08 20:12:01 +02:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2022-09-19 18:56:34 +02:00
|
|
|
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
2021-04-08 20:12:01 +02:00
|
|
|
run: yarn --frozen-lockfile
|
|
|
|
|
|
|
|
- name: Build code-server
|
2022-12-22 18:25:28 +01:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-04-08 20:12:01 +02:00
|
|
|
run: yarn build
|
|
|
|
|
2022-03-15 03:37:29 +01:00
|
|
|
# Get Code's git hash. When this changes it means the content is
|
2022-03-22 21:07:14 +01:00
|
|
|
# different and we need to rebuild.
|
2022-03-15 03:37:29 +01:00
|
|
|
- name: Get latest lib/vscode rev
|
2021-04-08 20:12:01 +02:00
|
|
|
id: vscode-rev
|
2023-03-14 21:52:53 +01:00
|
|
|
run: echo "rev=$(git rev-parse HEAD:./lib/vscode)" >> $GITHUB_OUTPUT
|
2021-04-08 20:12:01 +02:00
|
|
|
|
2022-07-19 21:34:01 +02:00
|
|
|
# We need to rebuild when we have a new version of Code, when any of
|
|
|
|
# the patches changed, or when the code-server version changes (since
|
|
|
|
# it gets embedded into the code). Use VSCODE_CACHE_VERSION to
|
|
|
|
# force a rebuild.
|
2022-03-22 21:07:14 +01:00
|
|
|
- name: Fetch prebuilt Code package from cache
|
|
|
|
id: cache-vscode
|
2024-02-02 02:38:25 +01:00
|
|
|
uses: actions/cache@v4
|
2020-05-08 02:44:32 +02:00
|
|
|
with:
|
2022-03-22 21:07:14 +01:00
|
|
|
path: lib/vscode-reh-web-*
|
2022-11-08 23:45:01 +01:00
|
|
|
key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }}
|
2021-04-08 20:12:01 +02:00
|
|
|
|
|
|
|
- name: Build vscode
|
2022-11-08 23:45:01 +01:00
|
|
|
env:
|
|
|
|
VERSION: "0.0.0"
|
2022-03-22 21:07:14 +01:00
|
|
|
if: steps.cache-vscode.outputs.cache-hit != 'true'
|
2021-04-08 20:12:01 +02:00
|
|
|
run: yarn build:vscode
|
|
|
|
|
|
|
|
# The release package does not contain any native modules
|
|
|
|
# and is neutral to architecture/os/libc version.
|
|
|
|
- name: Create release package
|
|
|
|
run: yarn release
|
|
|
|
if: success()
|
|
|
|
|
|
|
|
# https://github.com/actions/upload-artifact/issues/38
|
|
|
|
- name: Compress release package
|
|
|
|
run: tar -czf package.tar.gz release
|
|
|
|
|
2020-05-08 02:44:32 +02:00
|
|
|
- name: Upload npm package artifact
|
2024-01-05 23:32:10 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-05-08 02:44:32 +02:00
|
|
|
with:
|
|
|
|
name: npm-package
|
2021-04-08 20:12:01 +02:00
|
|
|
path: ./package.tar.gz
|
2020-05-08 02:44:32 +02:00
|
|
|
|
2022-09-27 20:46:37 +02:00
|
|
|
test-e2e:
|
|
|
|
name: Run e2e tests
|
2021-04-08 20:12:01 +02:00
|
|
|
needs: build
|
2022-12-06 21:28:27 +01:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
timeout-minutes: 25
|
2020-05-08 05:48:49 +02:00
|
|
|
steps:
|
2022-03-15 03:37:29 +01:00
|
|
|
- name: Checkout repo
|
2023-10-05 01:50:11 +02:00
|
|
|
uses: actions/checkout@v4
|
2021-04-08 20:12:01 +02:00
|
|
|
|
2023-09-21 01:33:28 +02:00
|
|
|
- name: Install system dependencies
|
|
|
|
run: sudo apt update && sudo apt install -y libkrb5-dev
|
|
|
|
|
2023-11-14 22:45:56 +01:00
|
|
|
- name: Install Node.js
|
2023-11-14 19:23:05 +01:00
|
|
|
uses: actions/setup-node@v4
|
2021-04-08 20:12:01 +02:00
|
|
|
with:
|
2023-11-14 22:45:56 +01:00
|
|
|
node-version-file: .node-version
|
2021-04-08 20:12:01 +02:00
|
|
|
|
2022-09-19 18:56:34 +02:00
|
|
|
- name: Fetch dependencies from cache
|
|
|
|
id: cache-node-modules
|
2024-02-02 02:38:25 +01:00
|
|
|
uses: actions/cache@v4
|
2022-09-19 18:56:34 +02:00
|
|
|
with:
|
|
|
|
path: "**/node_modules"
|
|
|
|
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
yarn-build-
|
|
|
|
|
2020-05-08 05:48:49 +02:00
|
|
|
- name: Download npm package
|
2024-01-05 23:32:33 +01:00
|
|
|
uses: actions/download-artifact@v4
|
2020-05-08 05:48:49 +02:00
|
|
|
with:
|
|
|
|
name: npm-package
|
2021-04-08 20:12:01 +02:00
|
|
|
|
|
|
|
- name: Decompress npm package
|
|
|
|
run: tar -xzf package.tar.gz
|
|
|
|
|
2022-09-27 20:46:37 +02:00
|
|
|
- name: Install release package dependencies
|
2022-12-08 18:37:42 +01:00
|
|
|
run: cd release && npm install --unsafe-perm --omit=dev
|
2021-04-08 20:12:01 +02:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2022-09-19 18:56:34 +02:00
|
|
|
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
2022-08-09 20:24:37 +02:00
|
|
|
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
2021-04-08 20:12:01 +02:00
|
|
|
|
2021-11-03 22:17:43 +01:00
|
|
|
- name: Install Playwright OS dependencies
|
2021-11-04 17:39:27 +01:00
|
|
|
run: |
|
|
|
|
./test/node_modules/.bin/playwright install-deps
|
|
|
|
./test/node_modules/.bin/playwright install
|
2021-04-08 20:12:01 +02:00
|
|
|
|
|
|
|
- name: Run end-to-end tests
|
2022-12-22 18:25:28 +01:00
|
|
|
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e
|
2021-04-08 20:12:01 +02:00
|
|
|
|
|
|
|
- name: Upload test artifacts
|
|
|
|
if: always()
|
2024-01-05 23:32:10 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-04-08 20:12:01 +02:00
|
|
|
with:
|
2021-04-14 21:03:47 +02:00
|
|
|
name: failed-test-videos
|
|
|
|
path: ./test/test-results
|
2022-08-09 20:24:37 +02:00
|
|
|
|
|
|
|
- name: Remove release packages and test artifacts
|
2022-09-27 20:46:37 +02:00
|
|
|
run: rm -rf ./release ./test/test-results
|
2022-08-09 20:24:37 +02:00
|
|
|
|
|
|
|
test-e2e-proxy:
|
2022-09-27 20:46:37 +02:00
|
|
|
name: Run e2e tests behind proxy
|
|
|
|
needs: build
|
2022-12-06 21:28:27 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2022-08-09 20:24:37 +02:00
|
|
|
timeout-minutes: 25
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2023-10-05 01:50:11 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-08-09 20:24:37 +02:00
|
|
|
|
2023-09-21 01:33:28 +02:00
|
|
|
- name: Install system dependencies
|
|
|
|
run: sudo apt update && sudo apt install -y libkrb5-dev
|
|
|
|
|
2023-11-14 22:45:56 +01:00
|
|
|
- name: Install Node.js
|
2023-11-14 19:23:05 +01:00
|
|
|
uses: actions/setup-node@v4
|
2022-08-09 20:24:37 +02:00
|
|
|
with:
|
2023-11-14 22:45:56 +01:00
|
|
|
node-version-file: .node-version
|
2022-08-09 20:24:37 +02:00
|
|
|
|
|
|
|
- name: Fetch dependencies from cache
|
2022-09-19 18:56:34 +02:00
|
|
|
id: cache-node-modules
|
2024-02-02 02:38:25 +01:00
|
|
|
uses: actions/cache@v4
|
2022-08-09 20:24:37 +02:00
|
|
|
with:
|
|
|
|
path: "**/node_modules"
|
|
|
|
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
yarn-build-
|
|
|
|
|
2022-09-27 20:46:37 +02:00
|
|
|
- name: Download npm package
|
2024-01-05 23:32:33 +01:00
|
|
|
uses: actions/download-artifact@v4
|
2022-08-09 20:24:37 +02:00
|
|
|
with:
|
2022-09-27 20:46:37 +02:00
|
|
|
name: npm-package
|
2022-08-09 20:24:37 +02:00
|
|
|
|
2022-09-27 20:46:37 +02:00
|
|
|
- name: Decompress npm package
|
|
|
|
run: tar -xzf package.tar.gz
|
|
|
|
|
|
|
|
- name: Install release package dependencies
|
2022-12-08 18:37:42 +01:00
|
|
|
run: cd release && npm install --unsafe-perm --omit=dev
|
2022-08-09 20:24:37 +02:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2022-09-19 18:56:34 +02:00
|
|
|
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
2022-08-09 20:24:37 +02:00
|
|
|
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
|
|
|
|
|
|
|
- name: Install Playwright OS dependencies
|
|
|
|
run: |
|
|
|
|
./test/node_modules/.bin/playwright install-deps
|
|
|
|
./test/node_modules/.bin/playwright install
|
|
|
|
|
|
|
|
- name: Cache Caddy
|
2024-02-02 02:38:25 +01:00
|
|
|
uses: actions/cache@v4
|
2022-08-09 20:24:37 +02:00
|
|
|
id: caddy-cache
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/caddy
|
|
|
|
key: cache-caddy-2.5.2
|
|
|
|
|
|
|
|
- name: Install Caddy
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
if: steps.caddy-cache.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
gh release download v2.5.2 --repo caddyserver/caddy --pattern "caddy_2.5.2_linux_amd64.tar.gz"
|
2023-02-06 18:56:47 +01:00
|
|
|
mkdir -p ~/.cache/caddy
|
2022-08-09 20:24:37 +02:00
|
|
|
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
|
|
|
|
|
|
|
|
- name: Start Caddy
|
|
|
|
run: sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
|
|
|
|
|
|
|
|
- name: Run end-to-end tests
|
2022-09-27 20:46:37 +02:00
|
|
|
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e:proxy --global-timeout 840000
|
2022-08-09 20:24:37 +02:00
|
|
|
|
|
|
|
- name: Stop Caddy
|
|
|
|
if: always()
|
|
|
|
run: sudo ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
|
|
|
|
|
|
|
|
- name: Upload test artifacts
|
|
|
|
if: always()
|
2024-01-05 23:32:10 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-08-09 20:24:37 +02:00
|
|
|
with:
|
|
|
|
name: failed-test-videos-proxy
|
|
|
|
path: ./test/test-results
|
2021-04-08 20:12:01 +02:00
|
|
|
|
|
|
|
- name: Remove release packages and test artifacts
|
2022-09-27 20:46:37 +02:00
|
|
|
run: rm -rf ./release ./test/test-results
|