From f4e016454dbb5fcbe5a037d15c416da1cc9e273f Mon Sep 17 00:00:00 2001 From: Donald Labaj Date: Wed, 12 Mar 2025 14:17:54 -0400 Subject: [PATCH 1/2] fix: remvoes caching. --- .eslintignore | 2 - .github/workflows/build-lint-test.yml | 92 --------------------------- .github/workflows/build.yml | 30 --------- .github/workflows/pr-preview.yml | 13 ---- .github/workflows/release.yml | 26 -------- .prettierignore | 2 +- jest.config.js | 1 - package.json | 4 +- 8 files changed, 3 insertions(+), 167 deletions(-) diff --git a/.eslintignore b/.eslintignore index f1667eff..95f208dc 100644 --- a/.eslintignore +++ b/.eslintignore @@ -6,9 +6,7 @@ tsc_out .changelog .DS_Store coverage -.cache .tmp -.eslintcache generated *.d.ts **/css/*.js diff --git a/.github/workflows/build-lint-test.yml b/.github/workflows/build-lint-test.yml index e2799235..5394b102 100644 --- a/.github/workflows/build-lint-test.yml +++ b/.github/workflows/build-lint-test.yml @@ -17,36 +17,11 @@ jobs: - uses: actions/setup-node@v1 with: node-version: '18' - - uses: actions/cache@v2 - id: yarn-cache - name: Cache npm deps - with: - path: | - node_modules - **/node_modules - key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }} - run: yarn install --frozen-lockfile - if: steps.yarn-cache.outputs.cache-hit != 'true' - - uses: actions/cache@v2 - id: css-in-js-cache - name: Cache css in js files - with: - path: | - packages/module/src/css/*.(t|j|mj)s - key: ${{ runner.os }}-css-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('packages/module/src/css/*') }} - name: generate run: cd packages/module && yarn generate - if: steps.css-in-js-cache.outputs.cache-hit != 'true' - - uses: actions/cache@v2 - id: dist - name: Cache dist - with: - path: | - packages/*/dist - key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }} - name: Build dist run: yarn build - if: steps.dist.outputs.cache-hit != 'true' lint: runs-on: ubuntu-latest env: @@ -63,22 +38,7 @@ jobs: - uses: actions/setup-node@v1 with: node-version: '18' - - uses: actions/cache@v2 - id: yarn-cache - name: Cache npm deps - with: - path: | - node_modules - **/node_modules - key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }} - run: yarn install --frozen-lockfile - if: steps.yarn-cache.outputs.cache-hit != 'true' - - uses: actions/cache@v2 - id: lint-cache - name: Load lint cache - with: - path: '.eslintcache' - key: ${{ runner.os }}-lint-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }} - name: ESLint run: yarn lint:js - name: MDLint @@ -100,37 +60,11 @@ jobs: - uses: actions/setup-node@v1 with: node-version: '18' - - uses: actions/cache@v2 - id: yarn-cache - name: Cache npm deps - with: - path: | - node_modules - **/node_modules - ~/.cache/Cypress - key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }} - run: yarn install --frozen-lockfile - if: steps.yarn-cache.outputs.cache-hit != 'true' - - uses: actions/cache@v2 - id: css-in-js-cache - name: Cache css in js files - with: - path: | - packages/module/src/css - key: ${{ runner.os }}-css-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('packages/module/src/css/*') }} - name: generate run: cd packages/module && yarn generate - if: steps.css-in-js-cache.outputs.cache-hit != 'true' - - uses: actions/cache@v2 - id: dist - name: Cache dist - with: - path: | - packages/*/dist - key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }} - name: Build dist run: yarn build - if: steps.dist.outputs.cache-hit != 'true' - name: PF4 Jest Tests run: yarn test --maxWorkers=2 test_a11y: @@ -150,37 +84,11 @@ jobs: - uses: actions/setup-node@v1 with: node-version: '18' - - uses: actions/cache@v2 - id: yarn-cache - name: Cache npm deps - with: - path: | - node_modules - **/node_modules - ~/.cache/Cypress - key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }} - run: yarn install --frozen-lockfile - if: steps.yarn-cache.outputs.cache-hit != 'true' - - uses: actions/cache@v2 - id: css-in-js-cache - name: Cache css in js files - with: - path: | - packages/module/src/css - key: ${{ runner.os }}-css-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('packages/module/src/css/*') }} - name: generate run: cd packages/module && yarn generate - if: steps.css-in-js-cache.outputs.cache-hit != 'true' - - uses: actions/cache@v2 - id: dist - name: Cache dist - with: - path: | - packages/*/dist - key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }} - name: Build dist run: yarn build - if: steps.dist.outputs.cache-hit != 'true' - name: Build docs run: yarn build:docs - name: A11y tests diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9cce233..d10982b5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,42 +14,12 @@ jobs: git fetch origin pull/$GH_PR_NUM/head:tmp git checkout tmp fi - - uses: actions/cache@v2 - id: setup-cache - name: Cache setup - with: - path: | - README.md - package.json - .tmplr.yml - packages/*/package.json - packages/*/patternfly-docs/content/** - packages/*/patternfly-docs/generated/** - key: ${{ runner.os }}-setup-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('package.json', 'packages/module/package.json') }} - name: Run build script run: ./devSetup.sh shell: bash - if: steps.setup-cache.outputs.cache-hit != 'true' - uses: actions/setup-node@v1 with: node-version: '18' - - uses: actions/cache@v2 - id: yarn-cache - name: Cache npm deps - with: - path: | - node_modules - **/node_modules - key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }} - run: yarn install --frozen-lockfile - if: steps.yarn-cache.outputs.cache-hit != 'true' - - uses: actions/cache@v2 - id: dist - name: Cache dist - with: - path: | - packages/*/dist - key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }} - name: Build dist run: yarn build - if: steps.dist.outputs.cache-hit != 'true' diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index ee24861e..91b9458f 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -24,14 +24,7 @@ jobs: - uses: actions/setup-node@v1 with: node-version: '18' - - uses: actions/cache@v2 - id: yarn-cache - name: Load npm deps from cache - with: - path: '**/node_modules' - key: ${{ runner.os }}-yarn-14-${{ hashFiles('yarn.lock') }} - run: yarn install --frozen-lockfile - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn lint:js name: Lint JS if: always() @@ -40,12 +33,6 @@ jobs: if: always() - run: yarn build name: Build component groups - - uses: actions/cache@v2 - id: docs-cache - name: Load webpack cache - with: - path: '.cache' - key: ${{ runner.os }}-v4-${{ hashFiles('yarn.lock') }} - run: yarn build:docs name: Build docs - run: node .github/upload-preview.js packages/module/public diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2c79dd7..17536318 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,36 +17,10 @@ jobs: - uses: actions/setup-node@v1 with: node-version: '18' - - uses: actions/cache@v2 - id: yarn-cache - name: Cache npm deps - with: - path: | - node_modules - **/node_modules - ~/.cache/Cypress - key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }} - run: yarn install --frozen-lockfile - if: steps.yarn-cache.outputs.cache-hit != 'true' - - uses: actions/cache@v2 - id: css-in-js-cache - name: Cache css in js files - with: - path: | - packages/module/src/css - key: ${{ runner.os }}-css-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('packages/module/src/css/*') }} - name: generate run: cd packages/module && yarn generate - if: steps.css-in-js-cache.outputs.cache-hit != 'true' - - uses: actions/cache@v2 - id: dist - name: Cache dist - with: - path: | - packages/*/dist - key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }} - name: Build dist run: yarn build - if: steps.dist.outputs.cache-hit != 'true' - name: Release to NPM run: cd packages/module && npx semantic-release@19.0.5 diff --git a/.prettierignore b/.prettierignore index 42d01df3..05f3422f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -6,7 +6,7 @@ tsc_out .changelog .DS_Store coverage -.cache + .tmp .eslintcache generated diff --git a/jest.config.js b/jest.config.js index ce4485c4..726a9e81 100644 --- a/jest.config.js +++ b/jest.config.js @@ -4,7 +4,6 @@ module.exports = { modulePathIgnorePatterns: [ '/packages/*.*/dist/*.*', '/packages/*.*/public/*.*', - '/packages/*.*/.cache/*.*' ], roots: ['/packages'], transform: { diff --git a/package.json b/package.json index 9a0b8bfd..8f4259b7 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "clean": "yarn workspace @patternfly/react-topology clean", "lint:js": "eslint . --ext .js,.jsx,.ts,.tsx --color", "lint:js:fix": "eslint . --ext .js,.jsx,.ts,.tsx --color --fix", - "lint:md": "eslint packages --ext md --no-eslintrc --config .eslintrc-md.json --cache", - "lint:md:fix": "eslint packages --ext md --no-eslintrc --config .eslintrc-md.json --cache --fix", + "lint:md": "eslint packages --ext md --no-eslintrc --config .eslintrc-md.json", + "lint:md:fix": "eslint packages --ext md --no-eslintrc --config .eslintrc-md.json --fix", "lint": "yarn lint:js && yarn lint:md", "lint:fix": "yarn lint:js:fix && yarn lint:md:fix", "test": "TZ=EST jest packages", From b28bd1998b2e6202e84565fad73bdd1cf01de492 Mon Sep 17 00:00:00 2001 From: Austin Sullivan Date: Wed, 12 Mar 2025 14:37:08 -0400 Subject: [PATCH 2/2] chore(config): Fix lint error --- jest.config.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/jest.config.js b/jest.config.js index 726a9e81..f9135419 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,10 +1,7 @@ module.exports = { clearMocks: true, testMatch: ['**/__tests__/**/*.{js,ts}?(x)', '**/*.test.{js,ts}?(x)'], - modulePathIgnorePatterns: [ - '/packages/*.*/dist/*.*', - '/packages/*.*/public/*.*', - ], + modulePathIgnorePatterns: ['/packages/*.*/dist/*.*', '/packages/*.*/public/*.*'], roots: ['/packages'], transform: { '^.+\\.[jt]sx?$': 'babel-jest',