Skip to content

Commit

Permalink
Add github workflow cache for Kotlin native dependencies (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoepelman authored Jul 7, 2024
1 parent a47524a commit 4f997a4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ jobs:
# and the publishing plugin requires it
java-version: 21
cache: 'gradle'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore caches
uses: actions/cache/restore@v4
with:
path: |
~/.konan
~/.npm
${{ steps.yarn-cache-dir-path.outputs.dir }}
key: build-${{ runner.os }}-${{ hashFiles('build.gradle.kts', '**/gradle-wrapper.properties', 'settings.gradle.kts', 'kotlin-js-store/yarn.lock') }}
# There should've been at least one test run that creates the cache at this point
fail-on-cache-miss: true
- name: Get Version
id: get-version
shell: bash
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,19 @@ jobs:
# and the publishing plugin requires it
java-version: 21
cache: 'gradle'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache Kotlin JS/Native dependencies
uses: actions/cache@v4
with:
path: |
~/.konan
~/.npm
${{ steps.yarn-cache-dir-path.outputs.dir }}
key: build-${{ runner.os }}-${{ hashFiles('build.gradle.kts', '**/gradle-wrapper.properties', 'settings.gradle.kts', 'kotlin-js-store/yarn.lock') }}
restore-keys: |
build-${{ runner.os }}-${{ hashFiles('build.gradle.kts') }}
build-${{ runner.os }}-
- name: Assemble & Test project
run: ./gradlew build

0 comments on commit 4f997a4

Please sign in to comment.