Skip to content

Commit

Permalink
Refactor(ci): Use setup-node cache instead of bahmutov/npm-install
Browse files Browse the repository at this point in the history
  * it appears that the caching ability of the library is broken
  * @see: bahmutov/npm-install#146

fixes #DS-1402
  • Loading branch information
literat committed Sep 11, 2024
1 parent 276c7b3 commit f59e3cb
Show file tree
Hide file tree
Showing 8 changed files with 268 additions and 880 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,23 @@ jobs:
strategy:
matrix:
# supporting primarily LTS
# There is a problem in colliding installation of dependencies
# do not know yet, what is causing this, but any combination except 18 is not working corectly
# @TODO: https://jira.almacareer.tech/browse/DS-1402
# node-version: [18, 20, 22]
node-version: [18]
node-version: [18, 20, 22]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Enable Corepack
run: corepack enable

- name: Fetch Git history
run: git fetch --no-tags --depth=50 origin main
- name: Configure Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install dependencies
uses: bahmutov/[email protected]
with:
useRollingCache: true
install-command: yarn --immutable
run: yarn --immutable --inline-builds

- name: Build packages
run: yarn build
17 changes: 6 additions & 11 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Enable Corepack
run: corepack enable

- name: Fetch Git history
run: git fetch --no-tags --depth=50 origin main
- name: Configure Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install dependencies
uses: bahmutov/[email protected]
with:
useRollingCache: true
install-command: yarn --immutable
run: yarn --immutable --inline-builds

- name: Run Commitlint
run: npx commitlint --color --verbose --from $(git merge-base origin/main HEAD)
12 changes: 5 additions & 7 deletions .github/workflows/component-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,17 @@ jobs:
# Omlet.dev uses Git History for analysis; Disable shallow clone
fetch-depth: 0

- name: Enable Corepack
run: corepack enable

- name: Configure Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Enable Corepack
run: corepack enable
cache: 'yarn'

- name: Install dependencies
uses: bahmutov/[email protected]
with:
useRollingCache: true
install-command: yarn --immutable
run: yarn --immutable --inline-builds

- name: Analyze
run: npx omlet analyze
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Node
- name: Enable Corepack
run: corepack enable

- name: Configure Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Enable Corepack
run: corepack enable
cache: 'yarn'

- name: Install dependencies
uses: bahmutov/[email protected]
with:
useRollingCache: true
install-command: yarn --immutable
run: yarn --immutable --inline-builds

# Wait for the Netlify preview URL to be ready
- name: Wait for Netlify Deploy
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@ jobs:
- name: Clone repository
uses: actions/checkout@v4

- name: Set up Node.js
- name: Enable Corepack
run: corepack enable

- name: Configure Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Enable Corepack
run: corepack enable
cache: 'yarn'

- name: Install dependencies
uses: bahmutov/[email protected]
with:
useRollingCache: true
install-command: yarn --immutable
run: yarn --immutable --inline-builds

- name: Build
run: yarn build
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/test-web-twig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Node
- name: Enable Corepack
run: corepack enable

- name: Configure Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Enable Corepack
run: corepack enable
cache: 'yarn'

- name: Install dependencies
uses: bahmutov/[email protected]
with:
useRollingCache: true
install-command: yarn --immutable
run: yarn --immutable --inline-builds

- name: Build Icons
working-directory: ./packages/icons
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node
- name: Enable Corepack
run: corepack enable

- name: Configure Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Enable Corepack
run: corepack enable
cache: 'yarn'

- name: Fetch Git history
run: git fetch --no-tags --depth=50 origin main

- name: Install dependencies
uses: bahmutov/[email protected]
with:
useRollingCache: true
install-command: yarn --immutable
run: yarn --immutable --inline-builds

- name: Build
run: yarn build
Expand Down
Loading

0 comments on commit f59e3cb

Please sign in to comment.