Skip to content

Commit

Permalink
Swap over to yarn instead of npm for CI jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonni committed Oct 31, 2023
1 parent 0f24c3b commit 4d75d3c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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}"
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion .github/workflows/typechecking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1

- run: yarn typecheck --if-present
- run: yarn typecheck
6 changes: 2 additions & 4 deletions .nano-staged.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
},
};

0 comments on commit 4d75d3c

Please sign in to comment.