Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
code

GitHub Action

Setup Kotlin

0.0.3

Setup Kotlin

code

Setup Kotlin

Install the Kotlin compiler

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Setup Kotlin

uses: fwilhe2/setup-kotlin@0.0.3

Learn more about this action in fwilhe2/setup-kotlin

Choose a version

Setup the Kotlin™ cli compiler in GitHub Actions

This action downloads the Kotlin compiler and installs it to the path. It won't touch the installed JREs.

As of now, it only supports downloading Kotlin 1.4.0.

It allows you to use the kotlinc and the kotlin tool to compile source code and run scripts.

Usage example:

name: CI
on:
  push:
  workflow_dispatch:
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: fwilhe2/setup-kotlin@main
    - run: kotlinc myProgram.kt -include-runtime -d /tmp/hello.jar; java -jar /tmp/hello.jar
    - run: kotlin myScript.main.kts

Running a script inline

If you provide a string-argument script, the action will execute it via kotlin-main-kts script definition jar, see this example:

    - uses: fwilhe2/setup-kotlin@main
      with:
        script: |
            #!/usr/bin/env kotlin
            //more kotlin script code here

Disclaimer

This software is not affiliated with or endorsed by the owner of the Kotlin trademark. The trademark is used to describe what this software does.

License

This software is released under the MIT License (MIT), see LICENSE for details.