浏览代码

[CI] filter remote links, setup nightly full check (#2811)

* only check local markdown links

* nightly circleci runs
/develop-newnormalization
GitHub 5 年前
当前提交
d4e58192
共有 4 个文件被更改,包括 42 次插入2 次删除
  1. 19
      .circleci/config.yml
  2. 9
      .pre-commit-config.yaml
  3. 16
      markdown-link-check.fast.json
  4. 0
      /markdown-link-check.full.json

19
.circleci/config.yml


markdown_link_check:
parameters:
precommit_command:
type: string
description: precommit hook to run
default: markdown-link-check
docker:
- image: circleci/node:12.6.0
working_directory: ~/repo

name: Run markdown-link-check via precommit
command: |
. venv/bin/activate
pre-commit run --hook-stage manual markdown-link-check --all-files
pre-commit run --hook-stage manual << parameters.precommit_command >> --all-files
protobuf_generation_check:
docker:

only: /[0-9]+(\.[0-9]+)*(\.dev[0-9]+)*/
branches:
ignore: /.*/
nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- develop
jobs:
- markdown_link_check:
name: markdown-link-check full
precommit_command: markdown-link-check-full

9
.pre-commit-config.yaml


# markdown-link-check doesn't support multiple files on the commandline, so this hacks around that.
# Note that you must install the package separately via npm. For example:
# brew install npm; npm install -g markdown-link-check
entry: bash -xc 'echo "$@" | xargs -n1 -t markdown-link-check -c markdown-link-check.config.json' --
entry: bash -xc 'echo "$@" | xargs -n1 -t markdown-link-check -c markdown-link-check.fast.json' --
stages: [manual]
- id: markdown-link-check-full
name: markdown-link-check-full
entry: bash -xc 'echo "$@" | xargs -n1 -t markdown-link-check -c markdown-link-check.full.json' --
language: system
types: [markdown]
exclude: ".*localized.*"
stages: [manual]
- id: validate-versions
name: validate library versions

16
markdown-link-check.fast.json


{
"ignorePatterns": [
{
"pattern": "^http://localhost",
"comment": "Ignore local tensorboard links"
},
{
"pattern": "^https://developer.nvidia.com/compute/machine-learning/cudnn/secure",
"comment": "Requires login"
},
{
"pattern": "^https?://",
"comment": "Skip external links for fast runs."
}
]
}

/markdown-link-check.config.json → /markdown-link-check.full.json

正在加载...
取消
保存