Skip to content
vlangPublic

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

33 stars

Watchers

22 watching

Forks

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

CI License: MIT

GitHub Action that allows you to setup a V environment.

Usage

- uses: vlang/setup-v@v1.7
  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: x86_64, arm64, aarch64, riscv64. Uses the 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: true

Output

This 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.

Troubleshooting

Build failures from source (unknown function: ...)

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: true to install the latest stable release instead of the default branch.
  • Specify a concrete version (for example weekly.2024.01 or a tag/SHA).

The action retries the build once and, if it still fails, reports the original build output together with these suggestions.

Contributors

Made with contributors-img.

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

33 stars

Watchers

22 watching

Forks

Releases

Packages

Used by

Contributors

Languages