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

CI: Speed up builds #152

Merged
merged 7 commits into from
Nov 22, 2022
Merged

CI: Speed up builds #152

merged 7 commits into from
Nov 22, 2022

Conversation

jackw
Copy link
Collaborator

@jackw jackw commented Nov 18, 2022

What this PR does / why we need it:
CI builds are slow due to multiple yarn installs happening. This PR addresses this by using the cache action to store the node_modules and generated/node_modules | yarn.lock files to speed up ci.

Before After
Screenshot 2022-11-18 at 11 03 39 Screenshot 2022-11-18 at 11 03 56

Also spruces up the readme a bit with badges and grafana logo. 😃

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

@jackw jackw added the chore Other changes that don't modify src or test files label Nov 18, 2022
@jackw jackw self-assigned this Nov 18, 2022
Copy link
Collaborator

@tolzhabayev tolzhabayev left a comment

Choose a reason for hiding this comment

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

https://stackoverflow.com/a/62244232

Solution 1 says:
you don't need actions/cache@v3 anymore and since you arleady use setup-node with cache: yarn you can just yarn --prefer-offline instead.

So basically:
remove https://github.com/grafana/plugin-tools/pull/152/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR21-R30

and change this line https://github.com/grafana/plugin-tools/pull/152/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR33

to

yarn install --immutable --prefer-offline

@jackw
Copy link
Collaborator Author

jackw commented Nov 21, 2022

Nice! Thanks for the feedback @tolzhabayev I've updated the PR with the suggested changes.

@tolzhabayev
Copy link
Collaborator

This part can also go I think?

- name: Cache node modules
uses: actions/cache@v3
with:
path: packages/create-plugin/generated/yarn.lock
key: yarn-generated-lock-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-generated-lock-${{ hashFiles('yarn.lock') }}

@jackw
Copy link
Collaborator Author

jackw commented Nov 21, 2022

This part can also go I think?

- name: Cache node modules
uses: actions/cache@v3
with:
path: packages/create-plugin/generated/yarn.lock
key: yarn-generated-lock-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-generated-lock-${{ hashFiles('yarn.lock') }}

Turns out you're right. Have removed it. 👍

Copy link
Collaborator

@tolzhabayev tolzhabayev left a comment

Choose a reason for hiding this comment

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

Send 🇮🇹

@jackw jackw merged commit 9b75054 into main Nov 22, 2022
@jackw jackw deleted the jackw/speed-up-ci branch November 22, 2022 09:50
@grafanabot
Copy link
Contributor

🚀 PR was released in @grafana/create-plugin@0.6.2 🚀

@grafanabot grafanabot added the released This issue/pull request has been released. label Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Other changes that don't modify src or test files released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants