Skip to content

Commit

Permalink
Update workflow for build job
Browse files Browse the repository at this point in the history
  • Loading branch information
ogaclejapan committed Sep 8, 2024
1 parent 947adce commit 443e7a9
Showing 1 changed file with 53 additions and 23 deletions.
76 changes: 53 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,53 @@ 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: 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: 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 ${{ matrix.os }}
if: matrix.os == 'macos-latest' && matrix.job == 'test'
run: ./gradlew iosX64Test

# ubuntu-latest
- name: Run tests on ${{ matrix.os }}
if: matrix.os == 'ubuntu-latest' && matrix.job == 'test'
run: |
./gradlew testDebugUnitTest desktopTest wasmJsTest

0 comments on commit 443e7a9

Please sign in to comment.