GitHub Action that installs and provisions supported tools for workflow steps in self-hosted runners. This relies on the agent having supported tooling installed.
This action works with the following tooling and repository files (in order of priority):
- goenv -
.go-version
- nodenv -
.node-version
,.nvmrc
- pyenv -
.python-version
- sdkman -
.sdkmanrc
- tfenv -
.terraform-version
Attempts to use configuration provided in the directory structure for each tool, but this can be overridden with additional configuration in the action.
When used with self-hosted runners it's possible to pre-install the tooling you
desire and allow action-setup-tools
to function as a version check in CI for
much faster workflows.
The Action relies on the checked out repository or workspace to have existing
configuration files, for each tool, present in the root level of the repository.
The Action takes no inputs and reads these configuration files, such as
.node-version
, to configure the tooling correctly for the workflow.
name: CI
on:
pull_request:
branches:
- "main"
jobs:
my-job:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup tools
uses: open-turo/action-setup-tools@v1
- name: Output current environment
run: env | sort
parameter | description |
---|---|
go | The version of golang that has been installed and is ready for use. |
node | The verison of Node.js that has been installed and is ready for use. |
java | The version of Java that has been installed and is ready for use. |
python | The version of Python that has been installed and is ready for use. |
terraform | The version of Terraform that has been installed and is ready for use. |
This action is a node20
action.
The following tool platforms are supported for configuration but not installation. If you are using a self-hosted runner you must pre-install these, or if you're using a hosted runner they must be installed separately.
By default the action will look for a .go-version
file in the root level
directory. If present it will setup the Golang environment to use that version
of go
, installing the specified version if necessary.
The Go tools are made available via goenv.
By default the action will look for a .sdkmanrc
file in the root level
directory. If present and if specifies a java
version it will setup the sdkman
environment to use that version of java
, installing it if necessary. More
information about sdkman
can be found here. Note that
the java version identifier is an sdkman version identifier that includes a
vendor identifier after a dash to indicate which vendor supplies the identified
version.
Note that because sdkman supports other tools like Kotlin, future support for additional tools via this Action is possible.
By default the action will look for a .node-version
file in the root level
directory. If present it will setup the node environment to use that version of
node, installing the specified version if necessary.
This will also attempt to install the yarn
command and make it available to
future steps in the workflow.
The Node.js tools are made available via nodenv.
By default the action will look for a .python-version
file in the root level
directory. If present it will setup the Python environment to use that version
of python, installing the specified version if necessary.
This will also make the pip
available for future steps in the workflow.
The Python tools are made available via pyenv.
By default the action will look for a .terraform-version
file in the root
level directory. If present it will setup the environment to use that version of
terraform
, installing the specified version if necessary.
Terraform is made available via tfenv.
This repository exports a sub-action, open-turo/action-setup-tools/versions@v1
which allows you to specify the exact version of the tools that you wish to use,
even if they do not have configuration files present in the repository root or
workspace.
This is not the recommended usage of this action since it can produce different
results in CI or in your local environment and is more difficult to maintain
than using .*-version
files.
Do not use this sub-action except in test workflows with fixed specific version requirements.
name: CI
on:
pull_request:
branches:
- "main"
jobs:
my-job:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure fixed test versions
uses: open-turo/action-setup-tools/versions@v1
with:
go: 1.17.6
java: 17.0.2-tem
node: 16.14.2
python: 3.10.2
terraform: 1.1.5
- name: Output current environment
run: env | sort
Please review Issues, post new Issues against this repository as needed.
Ensure that you have installed locally the following tools:
Please see here for guidelines on how to contribute to this project.