GitHub Action that allows you to setup a V environment.
- uses: vlang/setup-v@v1.4
with:
# Personal access token (PAT) used to fetch the repository. The PAT is configured
# with the local git config, which enables your scripts to run authenticated git
# commands. The post-job step removes the PAT.
#
# We recommend using a service account with the least permissions necessary.
# Also when generating a new PAT, select the least scopes necessary.
#
# [Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
#
# Default: ${{ github.token }}
token: ''
# Version to use. It can be the branch, tag or SHA to checkout from the V repository.
# Examples: 0.2.4, weekly.2022.07
version: ''
# File containing the version to use. It can contain the branch, tag or SHA to checkout from the V repository
# Examples: .v-version
version-file: ''
# Set this option if you want the action to check for the latest available version of V.
# If `stable` is false, it will check for the latest commit from the default branch.
check-latest: false
# Set this option if you want the action to use the stable version of V.
# Resolves the latest GitHub release tag. Can be combined with `check-latest`.
stable: false
# Target architecture for V to use. Examples: linux, macos, windows. Will use system architecture by default.
architecture: ''
# Directory to install V into.
# Defaults to ~/vlang/vlang_{platform}_{arch} when not provided.
# Example: /opt/v
path: ''
# Cache the V executable to speed up subsequent runs.
# Only applies when the `version` input is specified.
# Default: true
cache: true
# Remove non-essential files (examples, tests, benchmarks, docs) from the
# V installation directory after building. This prevents V's own repository
# files from interfering with project-level commands like `v fmt -verify .`.
# Default: true
clean: trueThis action will output the following variables:
bin-path: Path to the directory that contains the V binary.v-bin-path: Path to the V binary.version: Version of V that was used.architecture: Architecture that was used to install V.
When installing from the default branch, the action downloads the V source and
builds it using the prebuilt C translation (vc). If the V source references
functions that are not yet available in the prebuilt vc (a transient V
upstream issue), the build can fail with errors such as:
error: unknown function: help.print_and_exit
This is usually a temporary V infrastructure issue. Workarounds:
- Set
stable: trueto install the latest stable release instead of the default branch. - Specify a concrete
version(for exampleweekly.2024.01or a tag/SHA).
The action retries the build once and, if it still fails, reports the original build output together with these suggestions.
Made with contributors-img.