From cec70635bb76dafb4bd71f661268268e34467e3c Mon Sep 17 00:00:00 2001 From: Matt Krick Date: Tue, 16 Jul 2024 12:17:51 -0700 Subject: [PATCH] chore: parallelize codecheck (#9983) Signed-off-by: Matt Krick --- .github/workflows/style-check.yml | 46 +++++++++++++++++++++++++++++++ .github/workflows/test.yml | 4 +-- package.json | 2 +- 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/style-check.yml diff --git a/.github/workflows/style-check.yml b/.github/workflows/style-check.yml new file mode 100644 index 00000000000..c32ada2e9a6 --- /dev/null +++ b/.github/workflows/style-check.yml @@ -0,0 +1,46 @@ +name: Style Check +on: + push: + branches-ignore: + - "release-please--**" + - "release/v**" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + style-check: + runs-on: ubuntu-latest + permissions: + contents: "read" + id-token: "write" + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version-file: package.json + # Caching yarn dir & running yarn install is too slow + # Instead, we aggressively cache node_modules below to avoid calling install + + - name: Setup environment variables + run: | + NODE_VERSION=$(jq -r -j '.engines.node|ltrimstr("^")' package.json) + echo NODE_VERSION=$NODE_VERSION >> $GITHUB_ENV + echo NODE_VERSION=$NODE_VERSION + + - name: Get cached node modules + id: cache + uses: actions/cache@v3 + with: + path: | + **/node_modules + key: node_modules-${{ runner.arch }}-${{ env.NODE_VERSION }}-${{ hashFiles('yarn.lock') }} + + - name: Install node_modules + if: steps.cache.outputs.cache-hit != 'true' + run: yarn install --immutable + + - name: Check Code Quality + run: yarn codecheck diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bf71c93c8cd..b294e8933c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -99,8 +99,8 @@ jobs: - name: Kysely Codegen run: yarn pg:generate - - name: Check Code Quality - run: yarn codecheck + - name: Typecheck + run: yarn typecheck - name: Run server tests run: yarn test:server -- --reporters=default --reporters=jest-junit diff --git a/package.json b/package.json index d6e0e6be007..62f539d39e7 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "typecheck": "nx run-many --target=typecheck", "lintcheck": "nx run-many --target=lint:check", "stylecheck": "nx run-many --target=prettier:check", - "codecheck": "concurrently --names \"typecheck,lintcheck,stylecheck\" \"yarn typecheck\" \"yarn lintcheck\" \"yarn stylecheck\" ", + "codecheck": "concurrently --names \"lintcheck,stylecheck\" \"yarn lintcheck\" \"yarn stylecheck\" ", "ultrahook": "export $(grep ^ULTRAHOOK_API_KEY .env | tr -d \"'\") && ultrahook -k $ULTRAHOOK_API_KEY dev 3000", "precommit": "nx run-many --target=precommit --parallel=1", "postcheckout": "node scripts/generateGraphQLArtifacts.js &>/dev/null &",