diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d4729860..6384ad41 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,8 +3,33 @@ name: Pipeline on: [push, pull_request] jobs: - build: - name: "Build, Test and Publish" + test-linux: + uses: ./.github/workflows/test-target.yml + with: + runs-on: ubuntu-latest + tasks: check # all linux targets + JVM + JS + WasmJS + test-windows: + uses: ./.github/workflows/test-target.yml + with: + runs-on: windows-latest + tasks: mingwX64Test + test-macosX64: + uses: ./.github/workflows/test-target.yml + with: + runs-on: macos-13 # latest version with X64 processor + tasks: macosX64Test iosX64Test + test-macosArm64: + uses: ./.github/workflows/test-target.yml + with: + runs-on: macos-latest + tasks: macosArm64Test iosSimulatorArm64Test + publish: + name: "Build and Publish" + needs: + - test-linux + - test-windows + - test-macosX64 + - test-macosArm64 runs-on: macos-latest env: TERM: xterm-256color @@ -35,9 +60,6 @@ jobs: - name: Build run: ./gradlew assemble - - name: Check - run: ./gradlew check - - name: Assemble release run: ./gradlew assembleRelease env: diff --git a/.github/workflows/test-target.yml b/.github/workflows/test-target.yml new file mode 100644 index 00000000..e116f9a2 --- /dev/null +++ b/.github/workflows/test-target.yml @@ -0,0 +1,48 @@ +name: Execute tasks on specified runner + +on: + workflow_call: + inputs: + runs-on: + type: string + required: true + description: Runner to be used for tasks execution + tasks: + type: string + required: true + description: Tasks to be executed + +jobs: + run: + name: "Execute tasks ${{ inputs.tasks }} on ${{ inputs.runs-on }}" + runs-on: ${{ inputs.runs-on }} + env: + GRADLE_OPTS: "-Dorg.gradle.internal.launcher.welcomeMessageEnabled=false" + steps: + - name: Check out code + uses: actions/checkout@v4.1.7 + with: + fetch-depth: 0 + + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v3.4.2 + + - name: Set up JDK + uses: actions/setup-java@v4.2.1 + with: + java-version: 17 + distribution: temurin + + - name: Setup Gradle + uses: gradle/gradle-build-action@v3.4.2 + + - name: Cache konan dependencies + uses: actions/cache@v4 + with: + path: ~/.konan + key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Build + run: ./gradlew ${{ inputs.tasks }}