feat: add GitLab CI/CD integration for setup-vp#97
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 277acafbdc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
GitLab CI Test StepsReplace 1. Basic smoke testVerify that the setup works as expected under standard conditions. include:
- remote: "https://raw.githubusercontent.com/voidzero-dev/setup-vp/<test-ref>/gitlab/setup-vp.yml"
inputs:
setup-ref: "<test-ref>"
node-version: "22"
run-install: "true"
test:
extends: .setup-vp
image: node:22
script:
- vp --version
- node --version
- vp run testFor this test, check if the pipeline config is accepted and the setup correctly reaches the script section. You should see 2. Old Node image regression testEnsure that the setup remains compatible even when using an older Node image. include:
- remote: "https://raw.githubusercontent.com/voidzero-dev/setup-vp/<test-ref>/gitlab/setup-vp.yml"
inputs:
setup-ref: "<test-ref>"
node-version: "22"
run-install: "false"
test:
extends: .setup-vp
image: node:18
script:
- node --version
- vp --versionConfirm that the setup succeeds on the 3. Multi install entriesTest whether the include:
- remote: "https://raw.githubusercontent.com/voidzero-dev/setup-vp/<test-ref>/gitlab/setup-vp.yml"
inputs:
setup-ref: "<test-ref>"
node-version: "22"
run-install: |
- cwd: .
args: ['--frozen-lockfile']
test:
extends: .setup-vp
image: node:22
script:
- vp --versionVerify that the pipeline configuration is valid and that |
|
Today I will set up a continuous verification repository on GitLab, and the results will be synchronized. |
| @@ -0,0 +1,676 @@ | |||
| /// <reference types="node" /> | |||
| // @ts-check | |||
| import { createWriteStream, existsSync, readFileSync, statSync, writeFileSync } from "node:fs"; | |||
There was a problem hiding this comment.
GitHub Actions comes with a built-in Node.js runtime, so you can use TypeScript right out of the box. GitLab CI works a bit differently because this template is just a YAML definition that runs inside whatever image the user chooses. Since we can't guarantee Node.js will be there, we currently include a "vp env use" step in the job to set it up.
That said, if we simply make it a documented requirement that the environment must have Node.js, we can keep the configuration much cleaner. I think I'll go ahead and update it with that approach in mind.
There was a problem hiding this comment.
https://github.com/voidzero-dev/setup-vp/blob/main/vite.config.ts#L11 Currently not, GitHub Action also use scripts compiled with vp pack to run.
There was a problem hiding this comment.
Thanks for checking,
I think we can align the GitLab side with the GitHub Action model by shipping a precompiled JavaScript runtime and executing it with the Node.js that's already in the runner image. This way, we won't need to use vp env use inside the template to bootstrap Node.js anymore.
I'll go ahead and update the GitLab template and documentation based on the assumption that GitLab jobs using this template will run in an environment where Node.js is already available.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45e42bf985
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
resolves #88
Warning
This has not yet been tested from an actual GitLab CI/CD environment.
I thought it would be best to document the GitLab integration features as an RFC, so I’ve put everything together along with a diagram of the overall flow.
rfcs/assets/gitlab-runtime-flow.svg