refactor: delete lint, add typecheck job
This commit is contained in:
parent
0b1cfc91d9
commit
fe70ebf4d6
47
.github/workflows/build.yaml
vendored
47
.github/workflows/build.yaml
vendored
@ -60,10 +60,6 @@ jobs:
|
|||||||
run: yarn fmt
|
run: yarn fmt
|
||||||
if: success()
|
if: success()
|
||||||
|
|
||||||
- name: Run yarn lint
|
|
||||||
run: yarn lint
|
|
||||||
if: success()
|
|
||||||
|
|
||||||
lint-sh:
|
lint-sh:
|
||||||
name: Lint shell files
|
name: Lint shell files
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -108,6 +104,49 @@ jobs:
|
|||||||
if: failure()
|
if: failure()
|
||||||
uses: andymckay/cancel-action@0.2
|
uses: andymckay/cancel-action@0.2
|
||||||
|
|
||||||
|
typecheck:
|
||||||
|
name: Check TypeScript types
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 5
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Get changed files
|
||||||
|
id: changed-files
|
||||||
|
uses: tj-actions/changed-files@v23.2
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
./src/**/*
|
||||||
|
|
||||||
|
- name: Install Node.js v16
|
||||||
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "16"
|
||||||
|
|
||||||
|
- name: Fetch dependencies from cache
|
||||||
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
|
id: cache-yarn
|
||||||
|
uses: actions/cache@v3
|
||||||
|
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-yarn.outputs.cache-hit != 'true'
|
||||||
|
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Run tsc on TypeScript files
|
||||||
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
|
run: yarn typecheck
|
||||||
|
|
||||||
|
- name: Fail workflow
|
||||||
|
if: failure()
|
||||||
|
uses: andymckay/cancel-action@0.2
|
||||||
|
|
||||||
lint-ts:
|
lint-ts:
|
||||||
name: Lint TypeScript files
|
name: Lint TypeScript files
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
main() {
|
|
||||||
cd "$(dirname "$0")/../.."
|
|
||||||
|
|
||||||
tsc --noEmit --skipLibCheck
|
|
||||||
|
|
||||||
cd "$OLDPWD"
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
@ -26,11 +26,11 @@
|
|||||||
"publish:docker": "./ci/steps/docker-buildx-push.sh",
|
"publish:docker": "./ci/steps/docker-buildx-push.sh",
|
||||||
"_audit": "./ci/dev/audit.sh",
|
"_audit": "./ci/dev/audit.sh",
|
||||||
"fmt": "./ci/dev/fmt.sh",
|
"fmt": "./ci/dev/fmt.sh",
|
||||||
"lint": "./ci/dev/lint.sh",
|
|
||||||
"lint:helm": "./ci/dedv/helm.sh",
|
"lint:helm": "./ci/dedv/helm.sh",
|
||||||
"lint:sh": "shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files '*.sh' | grep -v 'lib/vscode')",
|
"lint:sh": "shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files '*.sh' | grep -v 'lib/vscode')",
|
||||||
"lint:ts": "eslint --max-warnings=0 --fix $(git ls-files '*.ts' '*.tsx' '*.js' | grep -v 'lib/vscode')",
|
"lint:ts": "eslint --max-warnings=0 --fix $(git ls-files '*.ts' '*.tsx' '*.js' | grep -v 'lib/vscode')",
|
||||||
"test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1",
|
"test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1",
|
||||||
|
"typecheck": "tsc -p tsconfig.json --noEmit --skipLibCheck",
|
||||||
"ci": "./ci/dev/ci.sh",
|
"ci": "./ci/dev/ci.sh",
|
||||||
"watch": "VSCODE_DEV=1 VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts",
|
"watch": "VSCODE_DEV=1 VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts",
|
||||||
"icons": "./ci/dev/gen_icons.sh"
|
"icons": "./ci/dev/gen_icons.sh"
|
||||||
|
Reference in New Issue
Block a user