Skip to content

Commit

Permalink
chore: parallelize codecheck (#9983)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Krick <[email protected]>
  • Loading branch information
mattkrick authored Jul 16, 2024
1 parent 5cb5a9c commit cec7063
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/style-check.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 &",
Expand Down

0 comments on commit cec7063

Please sign in to comment.