How Banksalad's Web Chapter Improved GitHub Actions-Based CI Speed
Key point
Banksalad reduced CI execution time to the 40-second range using GitHub Actions dependency caching, job parallelization, and a strategy of testing only changed files.
Details
Banksalad web frontend engineer Cho Seong-dong shared a CI speed improvement strategy to reduce GitHub Actions wait times. Under the previous approach, when 20 people used it, a total of 1 hour of wait time occurred, but by applying caching and parallel processing, the time from action start to finish was improved to the 40-second range.
To shorten dependency installation time, actions/cache@v3 was utilized. Using the package-lock.json hash as the key, node_modules was cached, and npm ci execution was skipped on a cache hit. This reduced dependency installation time from 1 minute 8 seconds to 21 seconds. However, it should be noted that there is no cache on the first commit, and older caches may be deleted due to storage limits on the free plan.
The Job structure was improved to increase execution efficiency. Previously, lint, test, and build were run sequentially in a single Job, but this was changed to split them into multiple Jobs for parallel execution. Since each Job is assigned an independent Runner, a dependency installation step is required for each, but wait times can be significantly reduced compared to sequential execution. For example, when each step takes 10 seconds, sequential execution takes 30 seconds, but parallel execution allows all results to be checked in just 10 seconds.
A strategy of testing only changed files was also introduced. git diff was used to lint only the changes, and Jest's changedSince option was used to narrow the test scope. Additionally, using the Nx tool allows building and testing only the projects affected by the changes, making it efficient. Nx internally performs complex caching calculations, and its free plan provides 2,000 minutes and 10GB of storage per month.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.