From 4aae5eaeca524cb952f1a63980e48af5e4846f0a Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Tue, 12 May 2020 19:33:34 -0400 Subject: [PATCH] CI fixes - Splits up test into fmt, lint and test - Fixes bug in build-packages.sh - Minor README.md fixes --- .github/workflows/ci.yaml | 18 ++++++++++++++++++ README.md | 14 +------------- ci/README.md | 8 ++++++-- ci/build/build-packages.sh | 4 ++-- ci/steps/fmt.sh | 17 +++++++++++++++++ ci/steps/lint.sh | 17 +++++++++++++++++ ci/steps/test.sh | 2 +- 7 files changed, 62 insertions(+), 18 deletions(-) create mode 100755 ci/steps/fmt.sh create mode 100755 ci/steps/lint.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f20b60f37..c2a97ddd8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,6 +3,24 @@ name: ci on: [push, pull_request] jobs: + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Run ./ci/steps/fmt.sh + uses: ./ci/container + with: + args: ./ci/steps/fmt.sh + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Run ./ci/steps/lint.sh + uses: ./ci/container + with: + args: ./ci/steps/lint.sh + test: runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index 7cd169465..a0f5e6b12 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ sudo systemctl enable --now code-server ```bash npm install -g code-server code-server +# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml ``` ### macOS @@ -48,19 +49,6 @@ brew service start code-server # Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml ``` -### SSH - -You can use [sshcode](https://github.com/codercom/sshcode) to start and use code-server on any Linux machine over SSH. - -```bash -sshcode user@dev.coder.com -# Downloads and installs code-server on dev.coder.com and opens it in a new browser window. -``` - -### Digital Ocean - -[![Create a Droplet](./doc/assets/droplet.svg)](https://marketplace.digitalocean.com/apps/code-server) - ### Docker ```bash diff --git a/ci/README.md b/ci/README.md index b09545246..b2539f8f7 100644 --- a/ci/README.md +++ b/ci/README.md @@ -31,7 +31,7 @@ This directory contains scripts used for the development of code-server. - [./dev/container](./dev/container) - See [CONTRIBUTING.md](../doc/CONTRIBUTING.md) for docs on the development container - [./dev/ci.sh](./dev/ci.sh) (`yarn ci`) - - Runs formatters, linters and tests + - Runs `yarn fmt`, `yarn lint` and `yarn test` - [./dev/fmt.sh](./dev/fmt.sh) (`yarn fmt`) - Runs formatters - [./dev/lint.sh](./dev/lint.sh) (`yarn lint`) @@ -106,8 +106,12 @@ This directory contains the container for CI. This directory contains a few scripts used in CI. Just helps avoid clobbering the CI configuration. +- [./steps/fmt.sh](./steps/fmt.sh) + - Runs `yarn fmt` after ensuring VS Code is patched +- [./steps/lint.sh](./steps/lint.sh) + - Runs `yarn lint` after ensuring VS Code is patched - [./steps/test.sh](./steps/test.sh) - - Runs `yarn ci` after ensuring VS Code is patched + - Runs `yarn test` after ensuring VS Code is patched - [./steps/release.sh](./steps/release.sh) - Runs the full release process - Generates the npm package at `./release` diff --git a/ci/build/build-packages.sh b/ci/build/build-packages.sh index 6eb93c544..dc7f61680 100755 --- a/ci/build/build-packages.sh +++ b/ci/build/build-packages.sh @@ -53,8 +53,8 @@ release_nfpm() { nfpm_config=$(envsubst < ./ci/build/nfpm.yaml) # The underscores are convention for .deb. - nfpm pkg -f <(echo "$nfpm_config") --target release-packages/code-server_"$VERSION_$ARCH.deb" - nfpm pkg -f <(echo "$nfpm_config") --target release-packages/code-server-"$VERSION-$ARCH.rpm" + nfpm pkg -f <(echo "$nfpm_config") --target "release-packages/code-server_${VERSION}_${ARCH}.deb" + nfpm pkg -f <(echo "$nfpm_config") --target "release-packages/code-server-$VERSION-$ARCH.rpm" } main "$@" diff --git a/ci/steps/fmt.sh b/ci/steps/fmt.sh new file mode 100755 index 000000000..f7b1bbb88 --- /dev/null +++ b/ci/steps/fmt.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -euo pipefail + +main() { + cd "$(dirname "$0")/../.." + + yarn + + git submodule update --init + # We do not `yarn vscode` to make test.sh faster. + # If the patch fails to apply, then it's likely already applied + yarn vscode:patch &> /dev/null || true + + yarn fmt +} + +main "$@" diff --git a/ci/steps/lint.sh b/ci/steps/lint.sh new file mode 100755 index 000000000..c58473fbf --- /dev/null +++ b/ci/steps/lint.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -euo pipefail + +main() { + cd "$(dirname "$0")/../.." + + yarn + + git submodule update --init + # We do not `yarn vscode` to make test.sh faster. + # If the patch fails to apply, then it's likely already applied + yarn vscode:patch &> /dev/null || true + + yarn lint +} + +main "$@" diff --git a/ci/steps/test.sh b/ci/steps/test.sh index 9430d1078..73c3520dc 100755 --- a/ci/steps/test.sh +++ b/ci/steps/test.sh @@ -11,7 +11,7 @@ main() { # If the patch fails to apply, then it's likely already applied yarn vscode:patch &> /dev/null || true - yarn ci + yarn test } main "$@"