Streamline Your Ballerina Workflow on GitHub with setup-ballerina GitHub Action

Hasitha Aravinda
Ballerina Swan Lake Tech Blog
2 min readMar 4, 2023

The setup-ballerina GitHub Action allows you to easily add the Ballerina (Swan Lake) distribution of your choice to your GitHub Action environment. This means you can now seamlessly integrate Ballerina into your GitHub workflow and automate your development process.

As part of the v1 release, the setup-ballerina GitHub Action needs mandatory input of the version of Ballerina Swan Lake distribution. The version should be in the form of “Swan Lake channel” as listed in the `bal dist list` command. This action is compatible with all major operating systems, including Ubuntu, MacOS, and Windows.

setup-ballerina in Action
setup-ballerina in Action

You can find a working example of using the setup-ballerina GitHub Action here.

Originally, setup-ballerina was one of my pet projects that have now been officially part of the Ballerina platform. With the introduction of setup-ballerina, users now have two options; ballerina-action and setup-ballerina for using Ballerina in their GitHub Actions workflows, providing them with greater flexibility and choice.

The main differences between ballerina-action and setup-ballerina are as follows:

  • Architecture: ballerina-action uses a Docker-based architecture, which means that the Ballerina command runs in a Docker environment. On the other hand, setup-ballerina is a composite action, where it downloads and installs the Ballerina distribution directly onto the workflow environment, allowing the bal command to run in the actual workflow environment.
  • Supported Ballerina Versions: ballerina-action supports both older and Swan Lake versions of Ballerina distribution. setup-ballerina@v1 supports only Swan Lake distributions.
  • Flexibility: setup-ballerina supplies more flexibility in terms of the Ballerina version and usage of the bal command on the actual workflow environment. Additionally, setup-ballerina can be used on any operating system that supports GitHub Actions, while ballerina-action is limited to the Docker-based environment.

In summary, setup-ballerina provides more flexibility and full bal command support. The choice of which action to use ultimately depends on your specific needs and workflow requirements.

--

--

Hasitha Aravinda
Ballerina Swan Lake Tech Blog

A Lead Developer of the Ballerina Language compiler and run-time and A primary contributor to the Ballerina Language specification.