From 4d75d3ca146b2bbe13fbbb1d16354c1f9a811ce9 Mon Sep 17 00:00:00 2001 From: Nicholas Nelson Date: Tue, 31 Oct 2023 15:31:06 -0700 Subject: [PATCH] Swap over to yarn instead of npm for CI jobs --- .github/workflows/lint.yml | 8 ++++---- .github/workflows/tests.yml | 10 +++++----- .github/workflows/typechecking.yml | 2 +- .nano-staged.mjs | 6 ++---- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8571c76f..a3ae637a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,13 +40,13 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: - cache: 'npm' + cache: 'yarn' - run: yarn install --immutable env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - - run: npm run lint --if-present + - run: yarn lint # This job just checks code style for in-template contributions. code-style: @@ -56,7 +56,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: - cache: 'npm' + cache: 'yarn' - - run: npm i prettier + - run: yarn add prettier - run: npx prettier --check "**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,json}" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e00e182d..306e1b12 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,14 +24,14 @@ jobs: - run: yarn install --immutable env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - - run: yarn test:main --if-present - - run: yarn test:preload --if-present - - run: yarn test:renderer --if-present + - run: yarn test:main + - run: yarn test:preload + - run: yarn test:renderer # I ran into problems trying to run an electron window in ubuntu due to a missing graphics server. # That's why this special command for Ubuntu is here - - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:e2e --if-present + - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:e2e if: matrix.os == 'ubuntu-latest' - - run: npm run test:e2e --if-present + - run: yarn test:e2e if: matrix.os != 'ubuntu-latest' diff --git a/.github/workflows/typechecking.yml b/.github/workflows/typechecking.yml index 359ddadf..e1bc06ae 100644 --- a/.github/workflows/typechecking.yml +++ b/.github/workflows/typechecking.yml @@ -23,4 +23,4 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - - run: yarn typecheck --if-present + - run: yarn typecheck diff --git a/.nano-staged.mjs b/.nano-staged.mjs index f69dd0d8..54deed6a 100644 --- a/.nano-staged.mjs +++ b/.nano-staged.mjs @@ -11,14 +11,12 @@ export default { '{package-lock.json,packages/**/{*.ts,*.vue,tsconfig.json}}': ({filenames}) => { // if dependencies was changed run type checking for all packages if (filenames.some(f => f.endsWith('package-lock.json'))) { - return ['npm run typecheck --if-present']; + return ['yarn typecheck']; } // else run type checking for staged packages const fileNameToPackageName = filename => filename.replace(resolve(process.cwd(), 'packages') + sep, '').split(sep)[0]; - return [...new Set(filenames.map(fileNameToPackageName))].map( - p => `npm run typecheck:${p} --if-present`, - ); + return [...new Set(filenames.map(fileNameToPackageName))].map(p => `yarn typecheck:${p}`); }, };