Anyone using github actions. Can someone please gu...
# kotlin-native
a
Anyone using github actions. Can someone please guide me on how I can cache konan (kotlin native compiler) to quicken my CI process? CI keeps downloading the artifacts everytime it runs.
a
Copy code
- name: Cache konan
      uses: actions/cache@v2
      with:
        path: |
          ~/.konan/dependencies
          ~/.konan/kotlin-native-macos-1.4.31
        key: ${{ runner.os }}-konan-1.4.31
        restore-keys: ${{ runner.os }}-konan-1.4.31
kotlin-native-macos - change for yourself
a
Thank you so much
what about ./konan/cache ?
isn't that also important to cache?
Also, can I add a wild card to 1.4.31 so as to be able to cache other kotlin versions as well without having to check the workfile?
a
I don’t want to use cache from another version of kotlin
On my macbook: 0B ./cache 750M ./kotlin-native-prebuilt-macos-1.4.31 1.3G ./dependencies
a
Thanks fam
a
You have different
key
and
restore-keys
You should remove
${{ hashFiles('**/*.konan*') }}
from
key
a
I see. Much much thanks. Funny thing is I am caching gradle like this and it works
Copy code
- name: Cache Gradle
        uses: actions/cache@v2
        with:
          path: ~/.gradle/caches
          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
          restore-keys: |
            ${{ runner.os }}-gradle-
I will match the
key
and
restore-keys
108 Views