Commit 1b771c90 authored by Dan Allen's avatar Dan Allen

don't run test suite for docs changes

- don't run tests and linter when branch begins with docs/
- otherwise, don't run tests and linter unless code was changed
- extract defs to top of file in GitLab CI config
- use merge operator to weave defs into job definitions in GitLab CI config
- upgrade container to 10.14.2 in GitLab CI config
- document docs/ prefix in contributing guide
parent 065e80d5
......@@ -2,13 +2,21 @@
version: '{build}'
branches:
except:
- /^docs\/./
- releases
skip_tags: true
only_commits:
# only_commits.files may not work with GitLab yet
files:
- .appveyor.yml
- package.json
- yarn.lock
- gulpfile.js/
- packages/
- test/
clone_depth: 5
environment:
matrix:
#- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# NODEJS_VERSION: 8
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
NODEJS_VERSION: 10
install:
......
image: node:10.14.1-stretch
stages: [init, verify, deploy]
image: node:10.14.2-stretch
stages: [ init, verify, deploy ]
.defs:
# only_code not used when an MR is created, hence the need for except_docs
- &only_code
only:
changes:
- .gitlab-ci.yml
- package.json
- yarn.lock
- '{gulpfile.js,packages,test}/**/*'
- &except_docs
except:
- /^docs\/./
- &cache_paths
paths:
- .cache/yarn
- &pull_cache
cache:
policy: pull
<<: *cache_paths
- &yarn_install
before_script:
- yarn --cache-folder=.cache/yarn --pure-lockfile > /dev/null
yarn:
stage: init
<<: *except_docs
<<: *only_code
cache:
paths: &cache_paths
- .cache/yarn
script:
- &run_yarn
yarn --cache-folder=.cache/yarn --pure-lockfile > /dev/null
<<: *cache_paths
<<: *yarn_install
script: $(npm bin)/antora version
lint:
stage: verify
cache: &pull_cache
policy: pull
paths: *cache_paths
script:
- *run_yarn
- $(npm bin)/gulp lint
<<: *except_docs
<<: *only_code
<<: *pull_cache
<<: *yarn_install
script: $(npm bin)/gulp lint
test:
stage: verify
cache: *pull_cache
script:
- *run_yarn
- $(npm bin)/gulp test
<<: *except_docs
<<: *only_code
<<: *pull_cache
<<: *yarn_install
script: $(npm bin)/gulp test
artifacts:
paths:
- coverage/
......
......@@ -136,10 +136,20 @@ We do not accept merge requests that do not come from a dedicated branch in a fo
. *Create a dedicated branch in your fork for your changes.*
Name the branch after the issue number it fixes along with a short textual hint.
Here's an example of a branch name for issue #2, which was to initiate the Gulp build:
+
--
Here's an example of a branch name for issue #2, which was to initiate the Gulp build:
issue-2-init-gulp-build
If your only working on docs, then add `docs/` to the beginning of the branch name.
Here's an example of a branch name for issue #168, which was to write documentation for the sitemap generation:
docs/issue-168-document-sitemap
The `docs/` prefix tells the CI server not to run the test suite.
--
. In the issue tracker, label the issue as *[Progress] Preparing Change* and make sure you're assigned to it so that the rest of the team knows you're working on it.
. *Make your changes.*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment