Skip to content

Commit

Permalink
chore: upgrade Yarn to a supported version
Browse files Browse the repository at this point in the history
Closes patternfly#9959

Signed-off-by: Jon Koops <[email protected]>
  • Loading branch information
jonkoops committed Apr 22, 2024
1 parent 9fa6654 commit f4b00c3
Show file tree
Hide file tree
Showing 15 changed files with 28,311 additions and 20,105 deletions.
36 changes: 36 additions & 0 deletions .github/actions/setup-project/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Setup project
description: Sets up Node.js and Yarn, and installs dependencies, including cache.

runs:
using: composite
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
check-latest: true

- name: Enable Corepack
shell: bash
run: corepack enable

- name: Get Yarn configuration
id: yarn-config
shell: bash
run: |
echo "cache-folder=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup Yarn cache
with:
# Also cache Cypress binary.
path: |
~/.cache/Cypress
${{ steps.yarn-config.outputs.cache-folder }}
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-cache-
- name: Install dependencies
shell: bash
run: yarn install --immutable
89 changes: 6 additions & 83 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- 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', 'packages/*/package.json') }}
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- uses: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down Expand Up @@ -59,20 +46,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- 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: ./.github/actions/setup-project
- uses: actions/cache@v2
id: lint-cache
name: Load lint cache
Expand All @@ -99,20 +73,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- 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: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down Expand Up @@ -148,20 +109,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- 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: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down Expand Up @@ -208,20 +156,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- 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: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down Expand Up @@ -264,19 +199,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- 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
- uses: ./.github/actions/setup-project
if: steps.yarn-cache.outputs.cache-hit != 'true'
- uses: actions/cache@v2
id: dist
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ jobs:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN_REDALLEN }} # needs to be an admin token to get around branch protection
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install deps
run: yarn install --frozen-lockfile
- uses: ./.github/actions/setup-project
- name: Build dist
run: yarn build && yarn build:umd
- name: Deploy to NPM and Github
Expand Down
105 changes: 7 additions & 98 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- 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: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down Expand Up @@ -62,20 +49,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- 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: ./.github/actions/setup-project
- uses: actions/cache@v2
id: lint-cache
name: Load lint cache
Expand All @@ -102,20 +76,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- 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: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down Expand Up @@ -151,20 +112,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- 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: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down Expand Up @@ -211,20 +159,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- 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: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down Expand Up @@ -267,20 +202,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- 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: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down Expand Up @@ -321,20 +243,7 @@ jobs:
token: ${{ secrets.GH_TOKEN_REDALLEN }} # needs to be an admin token to get around branch protection
fetch-depth: '0'
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- 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: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
Loading

0 comments on commit f4b00c3

Please sign in to comment.