Skip to content

Commit

Permalink
[FEQ] george / FEQ-2702 / Improve Coverall workflow time execution. P…
Browse files Browse the repository at this point in the history
…art 2. Adding caching npm packages (#17708)

* chore: add caching

* fix: 🚑 cache not reading form base repo

* fix: 🚑 add update cache workflow, fix coverall restore cache

* Rename update_cache.yml to update_npm_cache.yml
  • Loading branch information
heorhi-deriv authored Dec 3, 2024
1 parent a7ca6a2 commit d18125f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Reporter

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, edited]
name: Reporter
types: [opened, synchronize, edited]
jobs:
test:
name: Run tests in parallel
Expand All @@ -18,7 +17,17 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Setup Node
uses: './.github/actions/setup_node'
- name: Install dependencies
- name: Restore npm cache
uses: actions/cache/restore@v4
id: cache-npm
with:
path: |
node_modules
packages/*/node_modules
key: node_modules-cache-${{ hashFiles('package-lock.json', 'packages/*/package.json') }}
restore-keys: node_modules-cache-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: Install dependencies
uses: "./.github/actions/npm_install_from_cache"
- name: Build components package
working-directory: packages/components
Expand All @@ -28,7 +37,7 @@ jobs:
- name: Coveralls Parallel
uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949
with:
flag-name: ${{ matrix.shard}}
flag-name: ${{ matrix.shard }}
parallel: true

finish:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/update_npm_cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Update node modules cache

on:
push:
branches:
- master

jobs:
build_cache:
name: Build cache
runs-on: Runner_16cores_Deriv-app
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Setup Node
uses: './.github/actions/setup_node'
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
with:
path: |
node_modules
packages/*/node_modules
key: node_modules-cache-${{ hashFiles('package-lock.json', 'packages/*/package.json') }}
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: Install dependencies
uses: "./.github/actions/npm_install_from_cache"

0 comments on commit d18125f

Please sign in to comment.