Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speed up ci #325

Merged
merged 31 commits into from
Dec 12, 2023
Merged

speed up ci #325

merged 31 commits into from
Dec 12, 2023

Conversation

shamilovtim
Copy link
Member

@shamilovtim shamilovtim commented Dec 2, 2023

Reason for PR

CI runs especially on the test-with-browsers job were taking between 15 to 25 minutes. Some common optimizations were unimplemented and parallelism was not being used for tests despite GH for open source being free.

Implementation

  • bump action versions
  • add node cache
  • add playwright cache
  • replace docker with native node (see: introduce npx dwn-server#94)
  • parallelize browser tests
  • only do the minimum amount of work necessary for the browser workflow (e.g. building cjs isnt necessary there)

Results

  • CI runs are now consistently between 230% to 380% faster
  • Duration variance of ~10 minutes has almost completely been eliminated. Runs now finish in a fairly consistent time frame.
  • CI duration went from 15min to 25min (frequently 20min+) to 6min to 8min

Copy link

codesandbox bot commented Dec 2, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link
Contributor

github-actions bot commented Dec 2, 2023

TBDocs Report

✅ No errors or warnings

@web5/api

  • Project entry file: packages/api/src/index.ts

TBDocs Report Updated at 2023-12-11T22:22:11Z 11a7b67

Copy link

codecov bot commented Dec 2, 2023

Codecov Report

Merging #325 (11a7b67) into main (78c2de2) will increase coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #325      +/-   ##
==========================================
+ Coverage   92.80%   92.82%   +0.01%     
==========================================
  Files          76       76              
  Lines       17267    17267              
  Branches     1607     1607              
==========================================
+ Hits        16025    16028       +3     
+ Misses       1215     1212       -3     
  Partials       27       27              
Components Coverage Δ
api 96.94% <ø> (+0.21%) ⬆️
common 97.78% <ø> (ø)
credentials 94.56% <ø> (ø)
crypto 100.00% <ø> (ø)
dids 91.87% <ø> (ø)
agent 88.08% <ø> (ø)
identity-agent 56.81% <ø> (ø)
proxy-agent 58.43% <ø> (ø)
user-agent 55.22% <ø> (ø)

@shamilovtim shamilovtim self-assigned this Dec 2, 2023
@shamilovtim shamilovtim changed the base branch from main to tshamilov/test-watch December 2, 2023 08:36
@shamilovtim shamilovtim changed the base branch from tshamilov/test-watch to main December 2, 2023 10:02
@shamilovtim shamilovtim changed the title wip: ci speed up speed up ci Dec 3, 2023
@shamilovtim shamilovtim added the cicd CI/CD and Automation label Dec 3, 2023
@shamilovtim shamilovtim force-pushed the tshamilov/ci-speed branch 2 times, most recently from 267582e to 6d83857 Compare December 3, 2023 18:20
Copy link
Contributor

@frankhinek frankhinek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @shamilovtim ! Will be great to speed up the test runs for future PRs.

.github/workflows/alpha-npm.yml Outdated Show resolved Hide resolved
.github/workflows/alpha-npm.yml Outdated Show resolved Hide resolved
.github/workflows/docs-ci.yml Outdated Show resolved Hide resolved
.github/workflows/docs-ci.yml Outdated Show resolved Hide resolved
.github/workflows/docs-publish.yml Outdated Show resolved Hide resolved
.github/workflows/tests-ci.yml Outdated Show resolved Hide resolved
.github/workflows/tests-ci.yml Outdated Show resolved Hide resolved
.github/workflows/tests-ci.yml Outdated Show resolved Hide resolved
.github/workflows/tests-ci.yml Outdated Show resolved Hide resolved
packages/agent/web-test-runner.config.cjs Show resolved Hide resolved
@shamilovtim
Copy link
Member Author

resolved @frankhinek

@shamilovtim shamilovtim merged commit ba9527f into main Dec 12, 2023
30 checks passed
@shamilovtim shamilovtim deleted the tshamilov/ci-speed branch December 12, 2023 15:48
@shamilovtim shamilovtim mentioned this pull request Dec 19, 2023
finn-tbd pushed a commit that referenced this pull request Mar 19, 2024
* remove unnecessary npm install

* add npm caching

* cache playwright

* use newer env var api

* fix naming

* add native dwn server

* run dwn server natively

* cleanup bg processing

* dial in the browser build

* better naming

* add parallelism

* fix parallelism

* better naming

* weird bug

* cleaner parallel config

* fix

* fix

* harden agent test

* solidify parallel groups

* do another run

* add comment

* balance parallel groups

* browser groups

* Revert "browser groups"

This reverts commit 5371e54.

* merge

* pr review: pin commit hashes

* pr review: pin commit hashes

* rebase
finn-tbd pushed a commit that referenced this pull request Mar 19, 2024
* remove unnecessary npm install

* add npm caching

* cache playwright

* use newer env var api

* fix naming

* add native dwn server

* run dwn server natively

* cleanup bg processing

* dial in the browser build

* better naming

* add parallelism

* fix parallelism

* better naming

* weird bug

* cleaner parallel config

* fix

* fix

* harden agent test

* solidify parallel groups

* do another run

* add comment

* balance parallel groups

* browser groups

* Revert "browser groups"

This reverts commit 5371e54.

* merge

* pr review: pin commit hashes

* pr review: pin commit hashes

* rebase
finn-tbd pushed a commit that referenced this pull request Mar 19, 2024
* remove unnecessary npm install

* add npm caching

* cache playwright

* use newer env var api

* fix naming

* add native dwn server

* run dwn server natively

* cleanup bg processing

* dial in the browser build

* better naming

* add parallelism

* fix parallelism

* better naming

* weird bug

* cleaner parallel config

* fix

* fix

* harden agent test

* solidify parallel groups

* do another run

* add comment

* balance parallel groups

* browser groups

* Revert "browser groups"

This reverts commit 5371e54.

* merge

* pr review: pin commit hashes

* pr review: pin commit hashes

* rebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cicd CI/CD and Automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants