From 5b0f61f5a3988675c93fe4a2cc44812e733bc0f2 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 18 Jul 2023 13:46:38 -0700 Subject: [PATCH] ci: consolidate lint job --- .eslintrc.cjs | 4 +++- .github/workflows/test-all-packages.yml | 22 ++------------------ scripts/lint-with-types.sh | 27 ------------------------- 3 files changed, 5 insertions(+), 48 deletions(-) delete mode 100755 scripts/lint-with-types.sh diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 5d17ed26567..23dfedc0c48 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -2,6 +2,8 @@ /* eslint-env node */ const process = require('process'); +// we don't collect type info by default because the EXPERIMENTAL_useProjectService that provides viable perf +// is not yet compatible with running eslint in IDE const lintTypes = !!process.env.AGORIC_ESLINT_TYPES; const deprecatedForLoanContract = [ @@ -36,7 +38,7 @@ module.exports = { parser: '@typescript-eslint/parser', parserOptions: lintTypes ? { - // this is not yet compatible with eslint lsp so it's conditioned on AGORIC_ESLINT_TYPES + // this is not yet compatible with eslint lsp so it's contingent on AGORIC_ESLINT_TYPES EXPERIMENTAL_useProjectService: true, sourceType: 'module', project: [ diff --git a/.github/workflows/test-all-packages.yml b/.github/workflows/test-all-packages.yml index 16fd3a6a295..e1e60b0d5a8 100644 --- a/.github/workflows/test-all-packages.yml +++ b/.github/workflows/test-all-packages.yml @@ -56,7 +56,7 @@ jobs: # We run per package bc of https://github.com/typescript-eslint/typescript-eslint/issues/1192 # We split the package tests into two jobs because type linting # is inefficient and slow https://github.com/typescript-eslint/typescript-eslint/issues/2094 - lint-primary: + lint: timeout-minutes: 10 needs: build runs-on: ubuntu-latest @@ -66,25 +66,7 @@ jobs: with: node-version: '18.x' - # first job also does repo-level linting - - name: lint repo format - run: yarn lint:format - # eslint - - name: yarn lint primary - run: ./scripts/lint-with-types.sh primary - - lint-rest: - timeout-minutes: 10 - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/restore-node - with: - node-version: '18.x' - - - name: yarn lint rest - run: ./scripts/lint-with-types.sh rest + - run: yarn lint ################## # Fast-running tests run as a group: diff --git a/scripts/lint-with-types.sh b/scripts/lint-with-types.sh deleted file mode 100755 index 077c2c05958..00000000000 --- a/scripts/lint-with-types.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -# we don't collect type info by default because the EXPERIMENTAL_useProjectService that provides viable perf -# is not yet compatible with running eslint in IDE -export AGORIC_ESLINT_TYPES='keypresent' - -# CI and some VMs OOM without this -export NODE_OPTIONS='--max-old-space-size=8192' - -# argument used by CI to split this across two jobs -SCOPE=$1 - -# taking roughly half the time to eslint all packages -PRIMARY_PACKAGES="@agoric/{cosmos,ertp,governance,inter-protocol,swing-store,swingset-vat,vats,wallet,zoe}" - -case $SCOPE in -primary) - yarn lerna run --scope=$PRIMARY_PACKAGES --no-bail lint - ;; -rest) - yarn lerna run --ignore=$PRIMARY_PACKAGES --no-bail lint - ;; -*) - # all scopes - yarn lint - ;; -esac