diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..ae313fc4 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 00000000..74ea43d4 --- /dev/null +++ b/.github/workflows/check.yml @@ -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 \ No newline at end of file