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

Add caching for sbt dependencies and build artifacts (Issue #342) #344

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/codepreview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,27 @@ jobs:
with:
java-version: 'adopt:1.11.0-11'
node-version: '16.7.0'

- name: Cache sbt dependencies
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.cache/coursier
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}
restore-keys: |
${{ runner.os }}-sbt-
- name: Cache sbt build artifacts
uses: actions/cache@v2
with:
path: |
admin/target/scala-*
web/target/scala-*
server/target/universal/
key: ${{ runner.os }}-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-

- name: Compile
run: sbt compile
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,28 @@ jobs:
java-version: 'adopt:1.11.0-11'
node-version: '16.7.0'

- name: Cache sbt dependencies
uses: actions/cache@v2
with:
path: |
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, these items are already cached by other actions

~/.sbt
~/.ivy2/cache
~/.cache/coursier
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}
restore-keys: |
${{ runner.os }}-sbt-

- name: Cache sbt build artifacts
uses: actions/cache@v2
with:
path: |
Copy link
Contributor

Choose a reason for hiding this comment

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

These could be helpful but they don't really reduce the build time by much (~2m), I have an internal version which I'll push

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for your reply, Alex. I appreciate your feedback on the pull request and it's great to hear that you have an internal version that can further improve the build time. In that case, would you like me to close this pull request for now? Please let me know your thoughts

admin/target/scala-*
web/target/scala-*
server/target/universal/
key: ${{ runner.os }}-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-

- name: Check code format
run: sbt scalafmtCheckAll

Expand Down