浏览代码

Run precommit in its own job, cache the data (#3094)

/asymm-envs
GitHub 5 年前
当前提交
45c22d13
共有 5 个文件被更改,包括 45 次插入13 次删除
  1. 46
      .circleci/config.yml
  2. 5
      .pre-commit-config.yaml
  3. 4
      config/offline_bc_config.yaml
  4. 2
      config/sac_trainer_config.yaml
  5. 1
      test_requirements.txt

46
.circleci/config.yml


pytest --cov=ml-agents --cov=ml-agents-envs --cov=gym-unity --cov-report html --junitxml=test-reports/junit.xml -p no:warnings
- run:
name: Check Code Style using pre-commit
command: |
. venv/bin/activate
pre-commit run --show-diff-on-failure --all-files
- run:
name: Verify there are no hidden/missing metafiles.
# Renaming files or deleting files can leave metafiles behind that makes Unity very unhappy.
command: |

path: htmlcov
destination: htmlcov
pre-commit:
docker:
- image: circleci/python:3.7.3
working_directory: ~/repo/
steps:
- checkout
- run:
name: Combine precommit config and python versions for caching
command: |
cat .pre-commit-config.yaml > pre-commit-deps.txt
python -VV >> pre-commit-deps.txt
- restore_cache:
keys:
- v1-precommit-deps-{{ checksum "pre-commit-deps.txt" }}
- run:
name: Install Dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install --upgrade setuptools
pip install pre-commit
# Install the hooks now so that they'll be cached
pre-commit install-hooks
- save_cache:
paths:
- ~/.cache/pre-commit
- ./venv
key: v1-precommit-deps-{{ checksum "pre-commit-deps.txt" }}
- run:
name: Check Code Style using pre-commit
command: |
. venv/bin/activate
pre-commit run --show-diff-on-failure --all-files
markdown_link_check:
parameters:

pip_constraints: test_constraints_max_tf2_version.txt
- markdown_link_check
- protobuf_generation_check
- pre-commit
- deploy:
name: deploy ml-agents-envs
directory: ml-agents-envs

5
.pre-commit-config.yaml


types: [markdown]
- id: check-merge-conflict
args: [--assume-in-merge]
- id: check-yaml
# Won't handle the templating in yamato
exclude: \.yamato/*
- repo: https://github.com/pre-commit/mirrors-pylint
rev: v2.4.4

4
config/offline_bc_config.yaml


num_layers: 2
sequence_length: 32
memory_size: 256
demo_path: ./UnitySDK/Assets/Demonstrations/<Your_Demo_File>.demo
# Change the path here to point to your demo files
demo_path: ./UnitySDK/Assets/Demonstrations/Your_Demo_File.demo
FoodCollector:
trainer: offline_bc

batches_per_epoch: 5
num_layers: 2
hidden_units: 128
sequence_length: 16
use_recurrent: true
memory_size: 256
sequence_length: 32

2
config/sac_trainer_config.yaml


summary_freq: 3000
Hallway:
use_recurrent: true
sequence_length: 32
num_layers: 2
hidden_units: 128

use_recurrent: true
VisualHallway:
use_recurrent: true
sequence_length: 32
num_layers: 1
hidden_units: 128

1
test_requirements.txt


# Test-only dependencies should go here, not in setup.py
pytest>=3.2.2,<4.0.0
pre-commit
pytest-cov==2.6.1
正在加载...
取消
保存