mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-02-20 00:33:07 +01:00
chore(ci): faster yarn install (#11479)
This commit is contained in:
6
.github/workflows/validation.yml
vendored
6
.github/workflows/validation.yml
vendored
@@ -51,8 +51,12 @@ jobs:
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/.eslintrc.js') }}
|
||||
- name: check for duplicate dependencies
|
||||
run: yarn dedupe --check
|
||||
# We skip build of deps which is mostly unnecessary in CI and adds about 1 minute to yarn install
|
||||
# You can whitelist some build in root package.json dependenciesMeta if necessary
|
||||
- name: install deps
|
||||
run: yarn --immutable
|
||||
run: |
|
||||
echo -e "\nenableScripts: false" >> .yarnrc.yml
|
||||
yarn --immutable
|
||||
- name: check files for correct formatting
|
||||
run: yarn nx format:check
|
||||
- name: verify TS project references
|
||||
|
||||
@@ -42,5 +42,10 @@ module.exports = {
|
||||
// An array of regexp pattern strings that are matched against all module paths before those paths are
|
||||
// to be considered 'visible' to the module loader
|
||||
modulePathIgnorePatterns: ['libDev'],
|
||||
moduleNameMapper: { '^uuid$': require.resolve('uuid') },
|
||||
moduleNameMapper: {
|
||||
// Enforce usage of JS version of bcrypto in tests because on CI we don't build native modules because it's slowing yarn install
|
||||
'^bcrypto/lib/(.*)$': 'bcrypto/lib/$1-browser',
|
||||
// Enforce usage of CommonJS version of uuid because ESM version is not working in Jest
|
||||
'^uuid$': require.resolve('uuid'), // https://stackoverflow.com/questions/73203367/jest-syntaxerror-unexpected-token-export-with-uuid-library
|
||||
},
|
||||
};
|
||||
|
||||
@@ -3,6 +3,7 @@ const {
|
||||
testMatch,
|
||||
testPathIgnorePatterns,
|
||||
watchPathIgnorePatterns,
|
||||
moduleNameMapper,
|
||||
} = require('./jest.config.base');
|
||||
|
||||
const babelConfig = {
|
||||
@@ -25,6 +26,7 @@ module.exports = {
|
||||
testMatch,
|
||||
testPathIgnorePatterns,
|
||||
watchPathIgnorePatterns,
|
||||
moduleNameMapper,
|
||||
testEnvironment: 'jsdom',
|
||||
preset: 'jest-expo',
|
||||
|
||||
|
||||
3
nx.json
3
nx.json
@@ -5,7 +5,8 @@
|
||||
"{workspaceRoot}/nx.json",
|
||||
"{workspaceRoot}/.yarnrc.yml",
|
||||
"{workspaceRoot}/patches/*.patch",
|
||||
"{workspaceRoot}/package.json"
|
||||
"{workspaceRoot}/package.json",
|
||||
"{workspaceRoot}/.github/workflows/*.yml"
|
||||
],
|
||||
"default": ["{projectRoot}/**/*", "sharedGlobals"],
|
||||
"prod": ["default", "!{projectRoot}/**/*.test.{ts,tsx}"]
|
||||
|
||||
@@ -151,6 +151,12 @@
|
||||
"dependenciesMeta": {
|
||||
"core-js-pure": {
|
||||
"built": false
|
||||
},
|
||||
"electron": {
|
||||
"built": true
|
||||
},
|
||||
"trezor-suite": {
|
||||
"built": true
|
||||
}
|
||||
},
|
||||
"packageManager": "yarn@4.0.2"
|
||||
|
||||
@@ -32,6 +32,8 @@ module.exports = {
|
||||
'\\.(mp4)$': '<rootDir>/__mocks__/import-mp4.js',
|
||||
'\\.(svg)$': '<rootDir>/__mocks__/import-svg.js',
|
||||
uuid: require.resolve('uuid'), // https://stackoverflow.com/questions/73203367/jest-syntaxerror-unexpected-token-export-with-uuid-library
|
||||
// Enforce usage of JS version of bcrypto in tests because on CI we don't build native modules because it's slowing yarn install
|
||||
'^bcrypto/lib/(.*)$': 'bcrypto/lib/$1-browser',
|
||||
},
|
||||
moduleFileExtensions: ['js', 'ts', 'tsx'],
|
||||
coverageDirectory: './coverage',
|
||||
|
||||
Reference in New Issue
Block a user