Skip to content

Add GitHub actions #492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Build

on:
push:
branches:
- main
paths-ignore:
- '**/.gitignore'
- '**.md'
pull_request:
paths-ignore:
- '**/.gitignore'
- '**.md'
workflow_dispatch:

env:
JAVA_VERSION: 22
JAVA_DISTRO: 'temurin'

concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0

- name: Set up JDK
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}

- name: Set up gradle
uses: gradle/actions/setup-gradle@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0

- name: Build ${{ matrix.os }}
run: ./gradlew assemble

- name: Compile Linux Test
if: startsWith(matrix.os, 'ubuntu')
run: |
./gradlew linkDebugTestLinuxX64 linkDebugTestMingwX64 compileTestDevelopmentExecutableKotlinJs compileTestDevelopmentExecutableKotlinWasmJs

- name: Run Linux Test
if: startsWith(matrix.os, 'ubuntu')
run: |
./gradlew check --continue -x jsBrowserTest -x wasmJsBrowserTest

- name: Run Linux Browser Tests
if: startsWith(matrix.os, 'ubuntu')
run: ./gradlew jsBrowserTest -x wasmJsBrowserTest

- name: Run MacOS Test
if: startsWith(matrix.os, 'macos')
run: ./gradlew checkApple --continue

- name: Upload test results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: test-results-${{ matrix.os }}-publish
path: |
build/test-results
build/reports

# - name: Publish Linux
# if: startsWith(matrix.os, 'ubuntu') && github.event_name == 'push' && github.ref == 'refs/heads/main'
# run: |
# ./gradlew publishLinux

# - name: Publish MacOS
# if: startsWith(matrix.os, 'macos') && github.event_name == 'push' && github.ref == 'refs/heads/main'
# run: |
# ./gradlew publishMacos
40 changes: 40 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check

on:
push:
branches:
- main
paths-ignore:
- '**/.gitignore'
- '**.md'
pull_request:
paths-ignore:
- '**/.gitignore'
- '**.md'
workflow_dispatch:

env:
JAVA_VERSION: 22
JAVA_DISTRO: 'temurin'

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0

- name: Set up JDK
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}

- name: Set up gradle
uses: gradle/actions/setup-gradle@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0

- name: Check code
run: ./gradlew detekt