Skip to content

Commit

Permalink
chore: cache .konan directory
Browse files Browse the repository at this point in the history
  • Loading branch information
RyuNen344 committed Aug 21, 2023
1 parent fef759a commit 9807854
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 35 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root=true

[*]
charset=utf-8
end_of_line=lf
indent_style=space
insert_final_newline=true

[{*.bash,*.sh,*.zsh}]
indent_size=2
tab_width=2
17 changes: 16 additions & 1 deletion .github/actions/setup-java/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: 'Setup JDK'
name: "Setup JDK"
description: "setup JDK and gradle caching"

inputs:
java-version:
Expand Down Expand Up @@ -28,3 +29,17 @@ runs:
uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c # v2.7.0
with:
gradle-version: wrapper

- name: set konan cache key
id: konan-cache-key
run: echo "KEY=$(eval find . -name \"build.gradle*\" -o -name \"settings.gradle*\" | sort | xargs cat | shasum | awk '{print $1}')" >> "$GITHUB_OUTPUT"

- name: cache Konan
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
with:
path: |
~/.konan
key: v1-konan-${{ runner.os }}-${{ hashFiles('.xcode-version') }}-${{ steps.konan-cache-key.outputs.KEY }}
restore-keys: |
v1-konan-${{ runner.os }}-${{ hashFiles('.xcode-version') }}-${{ steps.konan-cache-key.outputs.KEY }}
v1-konan-${{ runner.os }}-${{ hashFiles('.xcode-version') }}
15 changes: 15 additions & 0 deletions .github/actions/xcode-select/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "select xcode"
description: "select xcode defined at .xcode-version"
runs:
using: "composite"
steps:
- name: read .xcode-version
shell: bash
run: |
echo "XCODE_VERSION=$(grep -oP "\d+(\.\d+)+" .xcode-version | awk -F. '{print $1 ".0"}' | uniq)" >> $GITHUB_ENV
- name: execute xcode-select
shell: bash
run: |
echo "select $XCODE_VERSION"
sudo xcode-select --switch "/Applications/Xcode_$XCODE_VERSION.app"
6 changes: 1 addition & 5 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ jobs:

- uses: ./.github/actions/setup-java

- name: Build all build type and flavor permutations
uses: gradle/gradle-build-action@243af859f8ca30903d9d7f7936897ca0358ba691 # v2
with:
gradle-home-cache-cleanup: true
arguments: assemble --stacktrace
- run: ./gradlew assemble --stacktrace

- name: Upload build outputs (APKs)
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/CompareScreenshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ jobs:
workflow: UnitTest.yml
branch: main

- name: compare screenshot test
id: compare-screenshot-test
uses: gradle/gradle-build-action@243af859f8ca30903d9d7f7936897ca0358ba691 # v2
with:
gradle-home-cache-cleanup: true
arguments: compareRoborazziDebug compareRoborazziDevDebug --stacktrace -Pscreenshot
- run: ./gradlew compareRoborazziDebug compareRoborazziDevDebug --stacktrace -Pscreenshot

- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: ${{ always() }}
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/Format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ jobs:

- uses: ./.github/actions/setup-java

- name: Check spotless
uses: gradle/gradle-build-action@243af859f8ca30903d9d7f7936897ca0358ba691 # v2
with:
gradle-home-cache-cleanup: true
arguments: spotlessCheck --stacktrace
- run: ./gradlew spotlessCheck --stacktrace

# - uses: reviewdog/action-setup@v1.0.6
#
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/UnitTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,9 @@ jobs:
name: event-payload
path: ${{ github.event_path }}

- name: Run local tests
uses: gradle/gradle-build-action@243af859f8ca30903d9d7f7936897ca0358ba691 # v2
with:
gradle-home-cache-cleanup: true
arguments: testDevDebugUnitTest testDebugUnitTest --stacktrace
- run: ./gradlew testDevDebugUnitTest testDebugUnitTest --stacktrace

- name: Get test coverage
uses: gradle/gradle-build-action@243af859f8ca30903d9d7f7936897ca0358ba691 # v2
with:
gradle-home-cache-cleanup: true
arguments: koverHtmlReportDebug koverHtmlReportDevDebug --stacktrace
- run: ./gradlew koverHtmlReportDebug koverHtmlReportDevDebug --stacktrace

- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: ${{ always() }}
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/iOSBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Select Xcode
run: sudo xcode-select -s '/Applications/Xcode_15.0.app'
- uses: ./.github/actions/xcode-select

- uses: ./.github/actions/setup-java

Expand All @@ -30,12 +29,6 @@ jobs:
- name: Set up XCFramework arch filter
run: echo "arch=x86_64" >> local.properties

- name: Build KMM Module
uses: gradle/gradle-build-action@243af859f8ca30903d9d7f7936897ca0358ba691 # v2
with:
gradle-home-cache-cleanup: true
arguments: :app-ios-shared:assembleSharedReleaseXCFramework --stacktrace

- name: Build App
working-directory: app-ios
run: bundle exec fastlane build_project
1 change: 1 addition & 0 deletions app-ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ platform :ios do

desc "Build DroidKaigi2023 project"
lane :build_project do
shared
xcodebuild(
xcargs: "-skipPackagePluginValidation",
project: project,
Expand Down

0 comments on commit 9807854

Please sign in to comment.