[CI] Parallelize eslint to speed it up (#136972) (#137006)

(cherry picked from commit 20dec08bf1)

Co-authored-by: Brian Seeders <brian.seeders@elastic.co>
This commit is contained in:
Kibana Machine 2022-07-22 17:54:03 -04:00 committed by GitHub
parent 51ff3b899e
commit 187031607e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

View file

@ -65,9 +65,9 @@ steps:
- command: .buildkite/scripts/steps/lint.sh
label: 'Linting'
agents:
queue: n2-2-spot
queue: n2-8-spot
key: linting
timeout_in_minutes: 90
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '-1'

View file

@ -31,9 +31,13 @@ steps:
- command: .buildkite/scripts/steps/lint.sh
label: 'Linting'
agents:
queue: n2-2
queue: n2-8-spot
key: linting
timeout_in_minutes: 90
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '-1'
limit: 3
- command: .buildkite/scripts/steps/lint_with_types.sh
label: 'Linting (with types)'

View file

@ -16,9 +16,9 @@ echo '--- Lint: eslint'
# after possibly commiting fixed files to the repo
set +e;
if is_pr && ! is_auto_commit_disabled; then
node scripts/eslint --no-cache --fix
git ls-files | grep -E '\.(js|mjs|ts|tsx)$' | xargs -n 250 -P 6 node scripts/eslint --no-cache --fix
else
node scripts/eslint --no-cache
git ls-files | grep -E '\.(js|mjs|ts|tsx)$' | xargs -n 250 -P 6 node scripts/eslint --no-cache
fi
eslint_exit=$?