-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/ci' into 'main'
ci: update ci for gitlab See merge request gperdomor/nx-tools!6
- Loading branch information
Showing
3 changed files
with
27 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,44 @@ | ||
include: | ||
- template: Workflows/MergeRequest-Pipelines.gitlab-ci.yml | ||
- component: gitlab.com/gl-components/nx-set-shas/[email protected] | ||
|
||
workflow: | ||
auto_cancel: | ||
on_new_commit: conservative | ||
|
||
default: | ||
image: node:20 | ||
|
||
variables: | ||
CI: 'true' | ||
GIT_DEPTH: 0 | ||
NX_CLOUD_ACCESS_TOKEN: $NX_CLOUD_TOKEN | ||
|
||
.node-cache: &node-cache | ||
key: | ||
files: | ||
- package-lock.json | ||
paths: | ||
- .npm/ | ||
policy: pull | ||
|
||
# Main job | ||
CI: | ||
interruptible: true | ||
only: | ||
- main | ||
- merge_requests | ||
cache: | ||
<<: *node-cache | ||
policy: pull-push | ||
script: | ||
# Connect your workspace on nx.app and uncomment this to enable task distribution. | ||
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested | ||
- npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" | ||
# This enables task distribution via Nx Cloud | ||
# Run this command as early as possible, before dependencies are installed | ||
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun | ||
# Connect your workspace by running "nx connect" and uncomment this | ||
# - npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" | ||
|
||
- npm ci | ||
- NX_HEAD=$CI_COMMIT_SHA | ||
- NX_BASE=${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA} | ||
- npm ci --cache .npm --prefer-offline | ||
|
||
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud | ||
# - npx nx-cloud record -- echo Hello World | ||
- npx nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD | ||
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected | ||
- npx nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Add files here to ignore them from prettier formatting | ||
/dist | ||
/coverage | ||
/tmp | ||
/.nx/cache | ||
/.nx/workspace-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters