浏览代码

Markdown link check in CI (#2543)

* check using xargs

* fix broken BC link

* install npm, run precommit before unit tests

* try to install npm

* try a node image build

* add workflow

* don't use precommit on node run

* sudo make me a sandwich

* pass config arg

* revert CI order change

* retry precommit

* sudo apt-get

* sudo npm

* make sure fails on bad link

* cleanup and refix link
/develop-gpu-test
GitHub 5 年前
当前提交
c8796488
共有 4 个文件被更改,包括 69 次插入1 次删除
  1. 41
      .circleci/config.yml
  2. 15
      .pre-commit-config.yaml
  3. 2
      docs/Training-SAC.md
  4. 12
      markdown-link-check.config.json

41
.circleci/config.yml


- store_artifacts:
path: htmlcov
destination: htmlcov
markdown_link_check:
docker:
- image: circleci/node:12.6.0
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-node-dependencies-{{ checksum ".pre-commit-config.yaml" }}
# fallback to using the latest cache if no exact match is found
- v1-node-dependencies-
- run:
name: Install Dependencies
command: |
sudo apt-get install python3-venv
python3 -m venv venv
. venv/bin/activate
pip install pre-commit
- run: sudo npm install -g markdown-link-check
- save_cache:
paths:
- ./venv
key: v1-node-dependencies-{{ checksum ".pre-commit-config.yaml" }}
- run:
name: Run markdown-link-check via precommit
command: |
. venv/bin/activate
pre-commit run --hook-stage manual markdown-link-check --all-files
workflows:
version: 2
build_and_test:
jobs:
- build
- markdown_link_check

15
.pre-commit-config.yaml


.*_pb2.py|
.*_pb2_grpc.py
)$
# "Local" hooks, see https://pre-commit.com/#repository-local-hooks
- repo: local
hooks:
- id: markdown-link-check
name: markdown-link-check
# 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' --
language: system
types: [markdown]
# Don't check localized files since their target might not be localized.
exclude: ".*localized.*"
# Only run manually, e.g. pre-commit run --hook-stage manual markdown-link-check
stages: [manual]

2
docs/Training-SAC.md


In some cases, you might want to bootstrap the agent's policy using behavior recorded
from a player. This can help guide the agent towards the reward. Pretraining adds
training operations that mimic a demonstration rather than attempting to maximize reward.
It is essentially equivalent to running [behavioral cloning](./Training-BehavioralCloning.md)
It is essentially equivalent to running [behavioral cloning](./Training-Behavioral-Cloning.md)
in-line with SAC.
To use pretraining, add a `pretraining` section to the trainer_config. For instance:

12
markdown-link-check.config.json


{
"ignorePatterns": [
{
"pattern": "^http://localhost",
"comment": "Ignore local tensorboard links"
},
{
"pattern": "^https://developer.nvidia.com/compute/machine-learning/cudnn/secure",
"comment": "Requires login"
}
]
}
正在加载...
取消
保存