Skip to content

Commit

Permalink
Add caching for Leiningen dependencies
Browse files Browse the repository at this point in the history
Introduced caching for Leiningen dependencies on GitHub actions workflow. This changes are made in order to improve build times and efficiency. The cache is now based on the hash of 'project.clj', ensuring up-to-date dependencies.
  • Loading branch information
Denis Smet committed Feb 10, 2024
1 parent 3fe2e5f commit f023de4
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ jobs:
cli: 'latest'
lein: 'latest'

- name: Cache Leiningen dependencies
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-lein-${{ hashFiles('**/project.clj') }}
restore-keys: ${{ runner.os }}-lein-

- name: 🧪 Unit tests
run: lein test

Expand All @@ -48,6 +55,13 @@ jobs:
cli: 'latest'
lein: 'latest'

- name: Cache Leiningen dependencies
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-lein-${{ hashFiles('**/project.clj') }}
restore-keys: ${{ runner.os }}-lein-

- name: 🧪 Generate coverage report
run: lein cloverage --lcov

Expand Down Expand Up @@ -81,6 +95,13 @@ jobs:
bb: 'latest'
clj-kondo: 'latest'

- name: Cache Leiningen dependencies
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-lein-${{ hashFiles('**/project.clj') }}
restore-keys: ${{ runner.os }}-lein-

- name: 👍 Eastwood
run: bb lint:eastwood

Expand Down Expand Up @@ -109,6 +130,13 @@ jobs:
cljfmt: 'latest'
cljstyle: 'latest'

- name: Cache Leiningen dependencies
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-lein-${{ hashFiles('**/project.clj') }}
restore-keys: ${{ runner.os }}-lein-

- name: 👍 cljfmt
run: bb style:cljfmt

Expand All @@ -135,6 +163,13 @@ jobs:
cli: 'latest'
bb: 'latest'

- name: Cache Leiningen dependencies
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-lein-${{ hashFiles('**/project.clj') }}
restore-keys: ${{ runner.os }}-lein-

- name: 🧪 Unit tests (bb + test-runner)
run: bb test

Expand Down

0 comments on commit f023de4

Please sign in to comment.