Skip to content

tests

tests #257

Workflow file for this run

name: tests
# Note: name shows up in a badge. Be careful about renaming.
on:
push:
branches: [ main ]
# Manual dispatch option is useful for triggering tests on a different branch
workflow_dispatch:
inputs:
target-linux:
type: boolean
description: "Linux"
default: true
target-win:
type: boolean
description: "Windows"
default: true
target-mac:
type: boolean
description: "Mac OS"
default: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- id: shouldrun
name: Should Run (early exit check)
if: |
(github.event_name == 'push' && matrix.os == 'ubuntu-latest') ||
(matrix.os == 'ubuntu-latest' && inputs.target-linux) ||
(matrix.os == 'windows-latest' && inputs.target-win) ||
(matrix.os == 'macos-latest' && inputs.target-mac)
run: echo "This workflow will run because the inputs are relevant to this machine."
- uses: actions/checkout@v4
if: steps.shouldrun.conclusion == 'success'
- uses: actions/setup-java@v4
if: steps.shouldrun.conclusion == 'success'
with:
distribution: temurin
java-version: 11
- name: Setup Gradle
if: steps.shouldrun.conclusion == 'success'
uses: gradle/actions/setup-gradle@v3
- name: Cache Kotlin Native compiler
if: steps.shouldrun.conclusion == 'success'
uses: actions/cache@v4
with:
path: ~/.konan
key: kotlin-native-compiler-${{ runner.OS }}
- name: Test with Gradle
if: steps.shouldrun.conclusion == 'success'
run: ./gradlew allTests --no-daemon