Skip to content

Commit

Permalink
🏗 Cache Karma's babel transforms during CircleCI builds (#32295)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimha committed Jan 29, 2021
1 parent 67b2bf1 commit 4443062
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@ executors:
resource_class: xlarge

commands:
save_karma_cache:
parameters:
cache_name:
type: string
steps:
- save_cache:
name: 'Save Karma Cache'
key: karma-cache-<<parameters.cache_name>>-{{ checksum "package-lock.json" }}
paths:
- .karma-cache
restore_karma_cache:
parameters:
cache_name:
type: string
steps:
- restore_cache:
name: 'Restore Karma Cache'
key: karma-cache-<<parameters.cache_name>>-{{ checksum "package-lock.json" }}
setup_vm:
steps:
- checkout
Expand Down Expand Up @@ -126,33 +144,49 @@ jobs:
name: amphtml-large-executor
steps:
- setup_vm
- restore_karma_cache:
cache_name: unit
- run:
name: 'Unit Tests'
command: node build-system/pr-check/unit-tests.js
- save_karma_cache:
cache_name: unit
'Unminified Tests':
executor:
name: amphtml-large-executor
steps:
- setup_vm
- restore_karma_cache:
cache_name: unminified
- run:
name: 'Unminified Tests'
command: node build-system/pr-check/unminified-tests.js
- save_karma_cache:
cache_name: unminified
'Nomodule Tests':
executor:
name: amphtml-large-executor
steps:
- setup_vm
- restore_karma_cache:
cache_name: nomodule
- run:
name: 'Nomodule Tests'
command: node build-system/pr-check/nomodule-tests.js
- save_karma_cache:
cache_name: nomodule
'Module Tests':
executor:
name: amphtml-large-executor
steps:
- setup_vm
- restore_karma_cache:
cache_name: module
- run:
name: 'Module Tests'
command: node build-system/pr-check/module-tests.js
- save_karma_cache:
cache_name: module
'End-to-End Tests':
executor:
name: amphtml-large-executor
Expand Down

0 comments on commit 4443062

Please sign in to comment.