Skip to content

Commit

Permalink
Markdown link check in CI (#2543)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Chris Elion authored Sep 12, 2019
1 parent 7fc5f54 commit 884a662
Showing 4 changed files with 69 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -62,3 +62,44 @@ jobs:
- 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 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -37,3 +37,18 @@ repos:
.*_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 changes: 1 addition & 1 deletion docs/Training-SAC.md
Original file line number Diff line number Diff line change
@@ -232,7 +232,7 @@ Default: `False`
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 changes: 12 additions & 0 deletions markdown-link-check.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"ignorePatterns": [
{
"pattern": "^http://localhost",
"comment": "Ignore local tensorboard links"
},
{
"pattern": "^https://developer.nvidia.com/compute/machine-learning/cudnn/secure",
"comment": "Requires login"
}
]
}

0 comments on commit 884a662

Please sign in to comment.