From 1b8a050a66d7748313607707a3ab6716ae4a2275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Jona=C5=A1?= Date: Mon, 16 May 2022 12:21:13 +0200 Subject: [PATCH] docs(nxdev): fix outdated gitlab docs (#10315) --- docs/shared/monorepo-ci-gitlab.md | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/docs/shared/monorepo-ci-gitlab.md b/docs/shared/monorepo-ci-gitlab.md index 79a07f3f5e894..c9910528192c6 100644 --- a/docs/shared/monorepo-ci-gitlab.md +++ b/docs/shared/monorepo-ci-gitlab.md @@ -20,12 +20,10 @@ Below is an example of a GitLab pipeline setup for an Nx workspace only building image: node:16 stages: - - setup - test - build -install-dependencies: - stage: setup +.distributed: interruptible: true only: - main @@ -38,14 +36,8 @@ install-dependencies: - .npm/ before_script: - npm ci --cache .npm --prefer-offline - -.distributed: - interruptible: true - only: - - main - - merge_requests - needs: - - install-dependencies + - NX_HEAD=$CI_COMMIT_SHA + - NX_BASE=${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA} artifacts: paths: - node_modules/.cache/nx @@ -54,31 +46,31 @@ workspace-lint: stage: test extends: .distributed script: - - npx nx workspace-lint + - npx nx workspace-lint --base=$NX_BASE --head=$NX_HEAD format-check: stage: test extends: .distributed script: - - npx nx format:check + - npx nx format:check --base=$NX_BASE --head=$NX_HEAD lint: stage: test extends: .distributed script: - - npx nx affected --base=HEAD~1 --target=lint --parallel=3 + - npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 test: stage: test extends: .distributed script: - - npx nx affected --base=HEAD~1 --target=test --parallel=3 --ci --code-coverage + - npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage build: stage: build extends: .distributed script: - - npx nx affected --base=HEAD~1 --target=build --parallel=3 + - npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 ``` The `build` and `test` jobs implement the CI workflow using `.distributed` as template to keep