Skip to content

Commit

Permalink
Add jobs to run test for all targets
Browse files Browse the repository at this point in the history
  • Loading branch information
OptimumCode committed Jun 23, 2024
1 parent fba96df commit 732c4cd
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 5 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -35,9 +60,6 @@ jobs:
- name: Build
run: ./gradlew assemble

- name: Check
run: ./gradlew check

- name: Assemble release
run: ./gradlew assembleRelease
env:
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/test-target.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 732c4cd

Please sign in to comment.