Skip to content

Commit fe70ebf

Browse files
committed
refactor: delete lint, add typecheck job
1 parent 0b1cfc9 commit fe70ebf

File tree

3 files changed

+44
-17
lines changed

3 files changed

+44
-17
lines changed

.github/workflows/build.yaml

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ jobs:
6060
run: yarn fmt
6161
if: success()
6262

63-
- name: Run yarn lint
64-
run: yarn lint
65-
if: success()
66-
6763
lint-sh:
6864
name: Lint shell files
6965
runs-on: ubuntu-latest
@@ -108,6 +104,49 @@ jobs:
108104
if: failure()
109105
uses: andymckay/cancel-action@0.2
110106

107+
typecheck:
108+
name: Check TypeScript types
109+
runs-on: ubuntu-latest
110+
timeout-minutes: 5
111+
steps:
112+
- name: Checkout repo
113+
uses: actions/checkout@v3
114+
115+
- name: Get changed files
116+
id: changed-files
117+
uses: tj-actions/changed-files@v23.2
118+
with:
119+
files: |
120+
./src/**/*
121+
122+
- name: Install Node.js v16
123+
if: steps.changed-files.outputs.any_changed == 'true'
124+
uses: actions/setup-node@v3
125+
with:
126+
node-version: "16"
127+
128+
- name: Fetch dependencies from cache
129+
if: steps.changed-files.outputs.any_changed == 'true'
130+
id: cache-yarn
131+
uses: actions/cache@v3
132+
with:
133+
path: "node_modules"
134+
key: yarn-build-${{ hashFiles('yarn.lock') }}
135+
restore-keys: |
136+
yarn-build-
137+
138+
- name: Install dependencies
139+
if: steps.changed-files.outputs.any_changed == 'true' && steps.cache-yarn.outputs.cache-hit != 'true'
140+
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
141+
142+
- name: Run tsc on TypeScript files
143+
if: steps.changed-files.outputs.any_changed == 'true'
144+
run: yarn typecheck
145+
146+
- name: Fail workflow
147+
if: failure()
148+
uses: andymckay/cancel-action@0.2
149+
111150
lint-ts:
112151
name: Lint TypeScript files
113152
runs-on: ubuntu-latest

ci/dev/lint.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
"publish:docker": "./ci/steps/docker-buildx-push.sh",
2727
"_audit": "./ci/dev/audit.sh",
2828
"fmt": "./ci/dev/fmt.sh",
29-
"lint": "./ci/dev/lint.sh",
3029
"lint:helm": "./ci/dedv/helm.sh",
3130
"lint:sh": "shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files '*.sh' | grep -v 'lib/vscode')",
3231
"lint:ts": "eslint --max-warnings=0 --fix $(git ls-files '*.ts' '*.tsx' '*.js' | grep -v 'lib/vscode')",
3332
"test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1",
33+
"typecheck": "tsc -p tsconfig.json --noEmit --skipLibCheck",
3434
"ci": "./ci/dev/ci.sh",
3535
"watch": "VSCODE_DEV=1 VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts",
3636
"icons": "./ci/dev/gen_icons.sh"

0 commit comments

Comments
 (0)