This RFC proposes a GitLab CI/CD remote template for voidzero-dev/setup-vp.
The template lets GitLab users install Vite+, configure registry auth, and
optionally run vp install while keeping the source of truth in this GitHub
repository.
The template is published as a plain YAML file plus a shell bootstrap. The
maintainable runtime is TypeScript under src/gitlab/ and is distributed as a
precompiled JavaScript bundle under dist/gitlab/.
gitlab/setup-vp.yml
gitlab/bootstrap.sh
src/gitlab/*.ts
dist/gitlab/index.mjs
GitLab users load it with include:remote:
include:
- remote: "https://raw.githubusercontent.com/voidzero-dev/setup-vp/v1/gitlab/setup-vp.yml"
test:
extends: .setup-vp
image: node:24
script:
- vp run testsetup-vp is currently a GitHub Action. Its TypeScript implementation depends
on the GitHub Actions runtime, including action inputs, path management, state,
outputs, and post-action cache behavior. GitLab CI/CD cannot execute that action
directly with equivalent semantics.
The goal is to provide a GitLab-native entry point without creating a separate GitLab project or mirror. GitLab supports remote YAML includes, so a template hosted from GitHub can be reused directly by GitLab pipelines.
Relevant GitLab documentation:
- https://docs.gitlab.com/ci/yaml/#includeremote
- https://docs.gitlab.com/ci/yaml/#includeinputs
- https://docs.gitlab.com/ci/yaml/#includeintegrity
- https://docs.gitlab.com/ci/caching/
- https://docs.gitlab.com/ci/migration/github_actions/
- Provide a GitLab CI/CD template from this GitHub repository only.
- Support
include:remotewithspec:inputs. - Keep GitLab input names as close as possible to the GitHub Action inputs.
- Install Vite+ from the official installer with retry and fallback URLs.
- Support the default
run-install: trueexperience and advancedrun-installentries withcwdandargs. - Support private registry auth through
registry-url,scope, andNODE_AUTH_TOKEN. - Support
sfw: trueforvp install. - Require Node.js in the selected GitLab runner image, matching the model that the runtime script is executed by Node.js.
- Document where GitLab behavior cannot match GitHub Actions.
- Do not create or require a GitLab project.
- Do not publish a GitLab CI/CD component.
- Do not use
include:componentfor the initial design. - Do not run the GitHub Action bundle (
dist/index.mjs) inside GitLab. - Do not implement GitHub Actions cache semantics inside the GitLab template.
- Do not provide Windows runner support in the initial template.
The template is stored in this repository and referenced by raw GitHub URL.
include:
- remote: "https://raw.githubusercontent.com/voidzero-dev/setup-vp/v1/gitlab/setup-vp.yml"Consumers should pin a tag or commit instead of main. GitLab 17.9+ users can
also use include:integrity when they want to pin the remote file hash.
include:
- remote: "https://raw.githubusercontent.com/voidzero-dev/setup-vp/v1.0.0/gitlab/setup-vp.yml"
integrity: "sha256-..."
inputs:
run-install: "true"include:component is intentionally not used. It is designed for GitLab CI/CD
components resolved from a GitLab component project, which conflicts with the
"GitHub repository only" constraint.
gitlab/setup-vp.yml defines two YAML documents and intentionally stays thin:
spec:inputsfor GitLab include inputs.- A hidden
.setup-vpjob that exports inputs, downloadsbootstrap.sh, and executes it.
spec:
inputs:
version:
default: "latest"
working-directory:
default: "."
run-install:
default: "true"
sfw:
type: boolean
default: false
registry-url:
default: ""
scope:
default: ""
setup-ref:
default: "v1"
---
.setup-vp:
before_script:
- |
# export inputs, download bootstrap.sh, and execute itImplementation logic is split to keep shell small:
gitlab/setup-vp.ymlhandles GitLab inputs and downloadsbootstrap.sh.gitlab/bootstrap.shinstalls Vite+, checks that Node.js is available, downloadsdist/gitlab/index.mjs, and runs it.src/gitlab/*.tshandles maintainable logic split by responsibility: registry auth,sfw,run-installparsing, install execution, shell helpers, path resolution, and final orchestration.dist/gitlab/index.mjsis generated fromsrc/gitlab/index.tsbyvp pack, mirroring how the GitHub Action runsdist/index.mjsgenerated from TypeScript.
This intentionally requires users to choose a runner image that already contains
Node.js, such as node:24. GitLab remote templates run inside the user-selected
image, so requiring Node.js keeps the template simple and avoids bootstrapping a
runtime before the compiled JavaScript can execute.
Remote includes do not provide a portable way for the included YAML to discover
the exact Git ref used in the include:remote URL. For that reason the template
has a setup-ref input. The default points at v1, and users who need strict
reproducibility should pass the same tag or commit SHA as the template include.
include:
- remote: "https://raw.githubusercontent.com/voidzero-dev/setup-vp/v1.0.0/gitlab/setup-vp.yml"
inputs:
setup-ref: "v1.0.0"The runtime handoff is intentionally explicit:
The hidden job runs in before_script so that the user's script can assume
vp is available.
- Export GitLab inputs into
SETUP_VP_*environment variables. - Download and execute
bootstrap.shfromsetup-ref. - Install Vite+ from
https://viteplus.dev/install.sh. - Fall back to the raw GitHub installer if the primary installer fails.
- Add
~/.vite-plus/bintoPATH. - Verify that
nodeis available in the runner image. - Download and execute
dist/gitlab/index.mjsfromsetup-ref. - Resolve
working-directory. - Configure temporary npm auth when
registry-urlis set. - Install or detect
sfwwhensfw: true. - Run
vp installwhenrun-installis enabled. - Print
vp --version.
The GitLab template does not expose node-version or node-version-file.
Instead, jobs must select an image or environment where Node.js is already
available:
test:
extends: .setup-vp
image: node:24
script:
- vp run testThis differs from the GitHub Action, where GitHub provides a built-in Node.js
runtime for actions. In both cases, TypeScript source is not executed directly:
GitHub Actions runs dist/index.mjs, and the GitLab template runs
dist/gitlab/index.mjs.
The default matches GitHub Actions:
run-install: "true"The GitLab template also supports multiple install entries:
include:
- remote: "https://raw.githubusercontent.com/voidzero-dev/setup-vp/v1/gitlab/setup-vp.yml"
inputs:
run-install: |
- cwd: ./packages/app
args: ['--frozen-lockfile']
- cwd: ./packages/lib
test:
extends: .setup-vp
image: node:24
script:
- vp run testThis is intentionally modeled after the GitHub Action's structured
run-install input rather than adding a separate install-args input. Keeping
one input avoids diverging user experience between GitHub and GitLab.
sfw: true wraps install commands as sfw vp install ....
include:
- remote: "https://raw.githubusercontent.com/voidzero-dev/setup-vp/v1/gitlab/setup-vp.yml"
inputs:
sfw: true
run-install: "true"If sfw is already on PATH, the template reuses it. Otherwise it downloads a
pinned sfw-free release for Linux or macOS when a matching binary exists. If
the runner architecture is unsupported, the template logs a warning and falls
back to plain vp install.
| Input | Default | Description |
|---|---|---|
version |
latest |
Version of Vite+ to install. |
working-directory |
. |
Project directory used for relative paths and default vp install execution. |
run-install |
true |
Run vp install; accepts boolean or YAML object/array with cwd and args. |
sfw |
false |
Wrap vp install with Socket Firewall Free. |
registry-url |
Optional registry URL to write to a temporary .npmrc. |
|
scope |
Optional scope for authenticating against scoped registries. | |
setup-ref |
v1 |
Ref used to download bootstrap.sh and dist/gitlab/index.mjs. |
| Capability | GitHub Action | GitLab template | Notes |
|---|---|---|---|
| Install Vite+ | Yes | Yes | GitLab uses shell in before_script. |
node-version |
Yes | No | GitLab requires Node.js in the runner image. |
node-version-file |
Yes | No | GitLab requires Node.js in the runner image. |
working-directory |
Yes | Yes | Used for relative paths and default install. |
run-install |
Yes | Yes | Structured cwd and args are supported. |
registry-url |
Yes | Yes | GitLab requires NODE_AUTH_TOKEN variable. |
scope |
Yes | Yes | Same input name. |
sfw |
Yes | Yes | GitLab supports Unix-like runners only. |
cache |
Yes | No | GitLab cache is job-level YAML behavior. |
cache-dependency-path |
Yes | No | See cache section below. |
The GitLab template does not expose cache or cache-dependency-path inputs.
This is an intentional difference.
The GitHub Action restores cache during the action's main phase and saves cache
during the action's post phase. GitLab cache is configured as a job keyword and
is restored by the runner before before_script starts. A remote template
running shell commands inside before_script cannot compute dynamic cache paths
and then ask GitLab to restore those paths for the same job.
GitLab users should configure cache: on their jobs directly:
test:
extends: .setup-vp
image: node:24
cache:
key:
files:
- pnpm-lock.yaml
paths:
- .pnpm-store/
script:
- vp run testFollow-up cache work should happen separately after deciding whether Vite+ should support a stable project-local package manager cache directory for GitLab.
Remote includes execute as CI configuration, so examples should recommend pinning:
- Prefer
v1, an immutable version tag such asv1.0.0, or a commit SHA. - Avoid
mainin production pipelines. - Use
include:integritywhere available for stricter remote file validation. - Pin
setup-refto the same immutable tag or commit SHA when strict reproducibility is required.include:integrityvalidates the included YAML, not the bootstrap or compiled runtime downloaded by that YAML.
The template downloads installers and optional sfw binaries at runtime. The
downloaded sfw version is pinned in the template for reproducibility. Users
who need stronger supply-chain guarantees can install a SHA-pinned sfw binary
before extending .setup-vp; the template will reuse sfw from PATH.
- Add
gitlab/setup-vp.yml. - Add
gitlab/bootstrap.sh. - Add the
src/gitlab/TypeScript runtime modules. - Generate
dist/gitlab/index.mjswithvp pack. - Add this RFC under
rfcs/. - Document GitLab usage in
README.md. - Validate YAML parsing and shell/Node syntax locally.
- Validate the remote include through GitLab CI Lint before release.
- Release under
v1and an immutable semver tag.