比较提交

...
此合并请求有变更与目标分支冲突。
/.github/workflows

3 次代码提交

作者 SHA1 备注 提交日期
Jonathan Harper b3bebf45 Remove windows testing 5 年前
Jonathan Harper 41952f49 Add env var for pip constraints 5 年前
Jonathan Harper 225b3db6 [WIP] Try out Github Actions 5 年前
共有 2 个文件被更改,包括 79 次插入0 次删除
  1. 79
      .github/workflows/deploy.yml

79
.github/workflows/deploy.yml


name: ML-Agents Python CI
on: push
jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.6', '3.7', '3.8']
pip-constraints: ['test_constraints_max_tf1_version.txt', 'test_constraints_max_tf2_version.txt', 'test_constraints_min_version.txt']
env:
PIP_CONSTRAINTS: ${{ matrix.pip-constraints }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Combine pip dependencies for caching
run: cat ml-agents/setup.py ml-agents-envs/setup.py gym-unity/setup.py test_requirements.txt $PIP_CONSTRAINTS > python_deps.txt
- uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('python_deps.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('python_deps.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- uses: actions/cache@v2
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('python_deps.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- name: Install dependencies
run: |
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install --upgrade setuptools
pip install --progress-bar=off -e ./ml-agents-envs -c $PIP_CONSTRAINTS
pip install --progress-bar=off -e ./ml-agents -c $PIP_CONSTRAINTS
pip install --progress-bar=off -r test_requirements.txt -c $PIP_CONSTRAINTS
pip install --progress-bar=off -e ./gym-unity -c $PIP_CONSTRAINTS
- name: Run Tests for ml-agents and gym_unity
run: |
. venv/bin/activate
mkdir test-reports
pip freeze > test-reports/pip_versions.txt
pytest -n 2 --cov=ml-agents --cov=ml-agents-envs --cov=gym-unity --cov-report html --junitxml=test-reports/junit.xml -p no:warnings
- name: Verify there are no hidden/missing metafiles.
# Renaming files or deleting files can leave metafiles behind that makes Unity very unhappy.
run: |
. venv/bin/activate
python utils/validate_meta_files.py
# pre-commit:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v1
# - name: set PY
# run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
# - uses: actions/cache@v1
# with:
# path: ~/.cache/pre-commit
# key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
# - uses: pre-commit/action@v1.1.0
正在加载...
取消
保存