Skip to content

Commit

Permalink
Merge pull request #91 from soil-kt/ci-test
Browse files Browse the repository at this point in the history
Update workflow for build job
  • Loading branch information
ogaclejapan authored Sep 8, 2024
2 parents 947adce + 4dbf619 commit 28f4ca5
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 24 deletions.
6 changes: 6 additions & 0 deletions .github/ci-gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Linux
# - CPU: 4 cores
# - Memory: 16 GB
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
#
org.gradle.jvmargs=-Xmx12g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8
83 changes: 60 additions & 23 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: Check PR

on:
pull_request:
branches: [ "main" ]
branches: ["main"]
paths-ignore:
- "docs/**"
- "art/**"
- "*.md"

concurrency:
group: pull_request-${{ github.ref }}
Expand All @@ -19,25 +21,60 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}

- name: Apply Spotless rules
run: ./gradlew spotlessApply

- name: Commit newly formatted files
uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: "**/*.kt **/*.gradle.kts **/*.yml"
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Apply spotless rules
run: ./gradlew spotlessApply

- name: Commit newly formatted files
uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: "**/*.kt **/*.gradle.kts **/*.yml"

build:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest ]
job: [ test ]

runs-on: ${{ matrix.os }}
permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Copy CI gradle.properties
if: matrix.os == 'ubuntu-latest' && matrix.job == 'test'
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup gradle
uses: gradle/actions/setup-gradle@v3

# macos-latest
- name: Run tests on macos
if: matrix.os == 'macos-latest' && matrix.job == 'test'
run: ./gradlew iosX64Test

# ubuntu-latest
- name: Run tests on linux
if: matrix.os == 'ubuntu-latest' && matrix.job == 'test'
run: |
./gradlew testDebugUnitTest desktopTest wasmJsTest
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kotlin.code.style=official
#Gradle
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8
org.gradle.caching=true
org.gradle.parallel=true
#Android
Expand Down

0 comments on commit 28f4ca5

Please sign in to comment.