Compare GitHub Actions and GitLab CI syntax for checks, artifacts, permissions and release controls.
Scope and conventions
GitHub Actions (hosted Ubuntu) and GitLab CI. Rows are independent; fragments need the stated placement and prerequisites. npm examples need package-lock.json and a test script. Pins checked 7 November 2026: checkout v7.0.1, setup-node v7.1.0, upload-artifact v7.0.2, download-artifact v8.0.2. Runner, permission and approval requirements are named; review pins for updates.
setup-node can cache npm’s download data keyed by the lockfile; it does not cache node_modules for you. A cache hit does not replace npm ci or prove artifact provenance.
Fragment
Steps-list fragment; requires a committed package-lock.json and preceding checkout.
.github/workflows/checks.yml
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
# Steps inside the test job, after checkout:- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 with: node-version: '26' cache: npm- run: npm ci
Upload selected generated files explicitly; job workspaces are not automatically shared. This example creates a demonstration text artifact, names it with the source revision and fails if the path is missing.
Fragment
Steps-list fragment for a build job. This produces an illustrative file, not an application release; retention/access policy remains a project decision.
needs establishes scheduling, not file transfer. Explicitly download the selected artifact from the intended run and verify its identity before promotion.
Fragment
Jobs fragment requiring the build job from the artifact-upload example in the same workflow run. File presence is demonstrated; production provenance verification needs additional checks.