Skip to content

Commit

Permalink
prepare workspace restore for reuse #639
Browse files Browse the repository at this point in the history
  • Loading branch information
thoutbeckers committed Feb 1, 2023
1 parent 065a08d commit 26c6414
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 29 deletions.
32 changes: 3 additions & 29 deletions .github/workflows/ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,10 @@ jobs:
matrix:
module: ${{ fromJSON(needs.build.outputs.projects) }}
steps:
- name: Gradle cache
uses: gradle/gradle-build-action@v2
- name: restore workspace
uses: ./.github/workflows/restore_workspace_macos.yaml
with:
gradle-home-cache-includes: |
caches
notifications
- name: Get cache of workspace
uses: actions/cache@v3
id: restore-build
with:
path: |
./*
!/.gradle
key: build-iOS-${{ github.sha }}

- name: set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11

- name: Konan cache
uses: actions/cache@v3
id: konan-cache
with:
path: |
~/.konan/cache/*
~/.konan/kotlin-native-prebuilt-macos-x86_64-${{ needs.build.outputs.kotlinVersion }}/*
key: konan-${{ needs.build.outputs.kotlinVersion }}
kotlinVersion: needs.build.outputs.kotlinVersion

- name: run tests
run: ./gradlew :${{ matrix.module }}:iosX64Test
37 changes: 37 additions & 0 deletions .github/workflows/restore_workspace_macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "restore macOS workspace from cache"
inputs:
kotlinVersion:
required: true
runs:
using: "composite"
steps:
- name: Gradle cache
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-includes: |
caches
notifications
- name: Get cache of workspace
uses: actions/cache@v3
id: restore-build
with:
path: |
./*
!/.gradle
key: build-iOS-${{ github.sha }}

- name: set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11

- name: Konan cache
uses: actions/cache@v3
id: konan-cache
with:
path: |
~/.konan/cache/*
~/.konan/kotlin-native-prebuilt-macos-x86_64-${{ needs.build.outputs.kotlinVersion }}/*
key: konan-${{ inputs.kotlinVersion }}
4 changes: 4 additions & 0 deletions .github/workflows/setup_macos.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: 'Setup macOS reusable workflow'

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=\"-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false\" -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dkotlin.daemon.jvm.options=-Xmx8G,-XX:MaxMetaspaceSize=512m,-Dorg.gradle.daemon=false,-Dkotlin.incremental=false"
JAVA_OPTS: "-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

on:
workflow_call:
inputs:
Expand Down

0 comments on commit 26c6414

Please sign in to comment.