Skip to content

Commit 6bb711f

Browse files
Fixed gha for move back to public repo. (#5838)
1 parent 93d3a51 commit 6bb711f

File tree

13 files changed

+62
-90
lines changed

13 files changed

+62
-90
lines changed

.github/workflows/colab.yml

+12-16
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@ on:
88
- 'colab/**'
99
- '.github/workflows/colab.yml'
1010
push:
11-
branches:
11+
branches:
1212
- main
1313
- develop
1414
- 'release/**'
1515
workflow_dispatch:
1616

1717
jobs:
1818
colab:
19-
# Only run on GitHub Enterprise
20-
if: ${{ github.server_url == 'https://github.cds.internal.unity3d.com' }}
21-
runs-on: [self-hosted, Linux, X64]
19+
runs-on: ubuntu-latest
2220
env:
2321
COLAB_ALWAYS_INSTALL_XVFB: 1
2422
QLEARNING_NUM_TRAINING_STEPS: 5
@@ -37,18 +35,16 @@ jobs:
3735
- uses: actions/setup-dotnet@v1
3836
with:
3937
dotnet-version: '6.0.x'
40-
# Caching not supported on GitHub Enterprise
41-
# See https://github.com/actions/cache/issues/505
42-
# - name: Cache pip
43-
# uses: actions/cache@v2
44-
# with:
45-
# # This path is specific to Ubuntu
46-
# path: ~/.cache/pip
47-
# # Look to see if there is a cache hit for the corresponding requirements file
48-
# key: ${{ runner.os }}-pip-${{ hashFiles('ml-agents/setup.py', 'ml-agents-envs/setup.py', 'gym-unity/setup.py', 'colab_requirements.txt') }}
49-
# restore-keys: |
50-
# ${{ runner.os }}-pip-
51-
# ${{ runner.os }}-
38+
- name: Cache pip
39+
uses: actions/cache@v2
40+
with:
41+
# This path is specific to Ubuntu
42+
path: ~/.cache/pip
43+
# Look to see if there is a cache hit for the corresponding requirements file
44+
key: ${{ runner.os }}-pip-${{ hashFiles('ml-agents/setup.py', 'ml-agents-envs/setup.py', 'gym-unity/setup.py', 'colab_requirements.txt') }}
45+
restore-keys: |
46+
${{ runner.os }}-pip-
47+
${{ runner.os }}-
5248
- name: Install dependencies
5349
run: |
5450
python -m pip install --upgrade pip

.github/workflows/lock.yml

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: dessant/lock-threads@v2
13-
# Only lock threads on public GitHub mirror, not enterprise.
14-
if: ${{ github.server_url == 'https://github.com' }}
1513
with:
1614
github-token: ${{ github.token }}
1715
issue-lock-inactive-days: '30'

.github/workflows/nightly.yml

+12-17
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ on:
77

88
jobs:
99
markdown-link-check-full:
10-
# Only run on GitHub Enterprise
11-
if: ${{ github.server_url == 'https://github.cds.internal.unity3d.com' }}
12-
runs-on: [self-hosted, Linux, X64]
10+
runs-on: ubuntu-latest
1311
steps:
1412
- uses: actions/checkout@v2
1513
with:
@@ -28,8 +26,7 @@ jobs:
2826
run: |
2927
pre-commit run --hook-stage manual markdown-link-check-full --all-files
3028
full-pytest:
31-
if: ${{ github.server_url == 'https://github.cds.internal.unity3d.com' }}
32-
runs-on: [ self-hosted, Linux, X64 ]
29+
runs-on: ubuntu-latest
3330
# TODO: Re-use pytest workflow once https://github.com/github/roadmap/issues/257 is done.
3431
# steps:
3532
# - uses: actions/checkout@v2
@@ -57,18 +54,16 @@ jobs:
5754
uses: actions/setup-python@v2
5855
with:
5956
python-version: ${{ matrix.python-version }}
60-
# Caching not supported on GitHub Enterprise
61-
# See https://github.com/actions/cache/issues/505
62-
# - name: Cache pip
63-
# uses: actions/cache@v2
64-
# with:
65-
# # This path is specific to Ubuntu
66-
# path: ~/.cache/pip
67-
# # Look to see if there is a cache hit for the corresponding requirements file
68-
# key: ${{ runner.os }}-pip-${{ hashFiles('ml-agents/setup.py', 'ml-agents-envs/setup.py', 'test_requirements.txt', matrix.pip_constraints) }}
69-
# restore-keys: |
70-
# ${{ runner.os }}-pip-
71-
# ${{ runner.os }}-
57+
- name: Cache pip
58+
uses: actions/cache@v2
59+
with:
60+
# This path is specific to Ubuntu
61+
path: ~/.cache/pip
62+
# Look to see if there is a cache hit for the corresponding requirements file
63+
key: ${{ runner.os }}-pip-${{ hashFiles('ml-agents/setup.py', 'ml-agents-envs/setup.py', 'test_requirements.txt', matrix.pip_constraints) }}
64+
restore-keys: |
65+
${{ runner.os }}-pip-
66+
${{ runner.os }}-
7267
- name: Display Python version
7368
run: python -c "import sys; print(sys.version)"
7469
- name: Install dependencies

.github/workflows/pre-commit.yml

+5-20
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@ on:
1111

1212
jobs:
1313
pre-commit:
14-
if: ${{ github.server_url == 'https://github.cds.internal.unity3d.com' }}
15-
runs-on: [self-hosted, Linux, X64]
14+
runs-on: ubuntu-20.04
1615
steps:
1716
- uses: actions/checkout@v2
18-
with:
19-
token: ${{ secrets.GHE_ACCESS_TOKEN }}
20-
submodules: recursive
2117
- uses: actions/setup-python@v2
2218
with:
2319
python-version: 3.8.x
@@ -26,10 +22,9 @@ jobs:
2622
ImageOS: ubuntu20
2723
with:
2824
ruby-version: '2.6'
29-
- uses: actions/setup-dotnet@v1
25+
- uses: actions/setup-dotnet@v3
3026
with:
31-
dotnet-version: '6.0.100'
32-
include-prerelease: true
27+
dotnet-version: '7.0.100'
3328
- name: Install manual dependencies
3429
run: |
3530
python -m pip install pre-commit
@@ -38,14 +33,9 @@ jobs:
3833
run: |
3934
pre-commit run --all-files
4035
markdown-link-check:
41-
# Only run on GitHub Enterprise
42-
if: ${{ github.server_url == 'https://github.cds.internal.unity3d.com' }}
43-
runs-on: [self-hosted, Linux, X64]
36+
runs-on: ubuntu-latest
4437
steps:
4538
- uses: actions/checkout@v2
46-
with:
47-
token: ${{ secrets.GHE_ACCESS_TOKEN }}
48-
submodules: recursive
4939
- uses: actions/setup-python@v2
5040
- uses: actions/setup-node@v2
5141
with:
@@ -60,13 +50,8 @@ jobs:
6050
run: |
6151
pre-commit run --hook-stage manual markdown-link-check --all-files
6252
validate-meta-files:
63-
# Only run on GitHub Enterprise
64-
if: ${{ github.server_url == 'https://github.cds.internal.unity3d.com' }}
65-
runs-on: [self-hosted, Linux, X64]
53+
runs-on: ubuntu-latest
6654
steps:
6755
- uses: actions/checkout@v2
68-
with:
69-
token: ${{ secrets.GHE_ACCESS_TOKEN }}
70-
submodules: recursive
7156
- uses: actions/setup-python@v2
7257
- run: python utils/validate_meta_files.py

.github/workflows/publish_docs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
publish:
88
name: Publish Docs to GH Pages
9-
runs-on: [self-hosted, Linux, X64]
9+
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v2

.github/workflows/publish_pypi.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ on:
1010

1111
jobs:
1212
build-and-publish:
13-
# Only run on GitHub Enterprise
14-
if: ${{ github.server_url == 'https://github.cds.internal.unity3d.com' }}
1513
name: publish to PyPI (or TestPyPI)
16-
runs-on: [self-hosted, Linux, X64]
14+
runs-on: ubuntu-latest
1715
strategy:
1816
matrix:
1917
package-path: [ml-agents, ml-agents-envs]

.github/workflows/publish_pypi_python_api.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ on:
1010

1111
jobs:
1212
build-and-publish:
13-
# Only run on GitHub Enterprise
14-
if: ${{ github.server_url == 'https://github.cds.internal.unity3d.com' }}
1513
name: publish to PyPI (or TestPyPI)
16-
runs-on: [self-hosted, Linux, X64]
14+
runs-on: ubuntu-latest
1715
strategy:
1816
matrix:
1917
package-path: [ml-agents-envs]

.github/workflows/pytest.yml

+11-15
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ on:
3030

3131
jobs:
3232
pytest:
33-
# Only run on GitHub Enterprise
34-
if: ${{ github.server_url == 'https://github.cds.internal.unity3d.com' }}
35-
runs-on: [self-hosted, Linux, X64]
33+
runs-on: ubuntu-latest
3634
env:
3735
TEST_ENFORCE_BUFFER_KEY_TYPES: 1
3836
strategy:
@@ -53,18 +51,16 @@ jobs:
5351
uses: actions/setup-python@v2
5452
with:
5553
python-version: ${{ matrix.python-version }}
56-
# Caching not supported on GitHub Enterprise
57-
# See https://github.com/actions/cache/issues/505
58-
# - name: Cache pip
59-
# uses: actions/cache@v2
60-
# with:
61-
# # This path is specific to Ubuntu
62-
# path: ~/.cache/pip
63-
# # Look to see if there is a cache hit for the corresponding requirements file
64-
# key: ${{ runner.os }}-pip-${{ hashFiles('ml-agents/setup.py', 'ml-agents-envs/setup.py', 'test_requirements.txt', matrix.pip_constraints) }}
65-
# restore-keys: |
66-
# ${{ runner.os }}-pip-
67-
# ${{ runner.os }}-
54+
- name: Cache pip
55+
uses: actions/cache@v2
56+
with:
57+
# This path is specific to Ubuntu
58+
path: ~/.cache/pip
59+
# Look to see if there is a cache hit for the corresponding requirements file
60+
key: ${{ runner.os }}-pip-${{ hashFiles('ml-agents/setup.py', 'ml-agents-envs/setup.py', 'test_requirements.txt', matrix.pip_constraints) }}
61+
restore-keys: |
62+
${{ runner.os }}-pip-
63+
${{ runner.os }}-
6864
- name: Display Python version
6965
run: python -c "import sys; print(sys.version)"
7066
- name: Install dependencies

.pre-commit-config.yaml

+12-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
)$
1212
1313
- repo: https://github.com/pre-commit/mirrors-mypy
14-
rev: v0.931
14+
rev: v0.991
1515
hooks:
1616
- id: mypy
1717
name: mypy-ml-agents
@@ -81,16 +81,21 @@ repos:
8181
types: [markdown]
8282
exclude: ".*localized.*"
8383

84-
- repo: https://github.com/dotnet/format
85-
rev: v5.1.225507
86-
hooks:
87-
- id: dotnet-format
88-
entry: dotnet-format whitespace
89-
args: [--folder, --include]
84+
#- repo: https://github.com/dotnet/format
85+
# rev: v5.1.225507
86+
# hooks:
87+
# - id: dotnet-format
88+
# entry: dotnet-format whitespace
89+
# args: [--folder, --include]
9090

9191
# "Local" hooks, see https://pre-commit.com/#repository-local-hooks
9292
- repo: local
9393
hooks:
94+
- id: dotnet-format
95+
name: dotnet-format
96+
language: system
97+
entry: dotnet format whitespace --folder --include
98+
types_or: ["c#"]
9499
- id: markdown-link-check
95100
name: markdown-link-check
96101
entry: utils/run_markdown_link_check.py

Project/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public float TargetWalkingSpeed
3838
public Transform TargetPrefab; //Target prefab to use in Dynamic envs
3939
private Transform m_Target; //Target the agent will walk towards during training.
4040

41-
[Header("Body Parts")] [Space(10)] public Transform body;
41+
[Header("Body Parts")][Space(10)] public Transform body;
4242
public Transform leg0Upper;
4343
public Transform leg0Lower;
4444
public Transform leg1Upper;

Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/JointDriveController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Unity.MLAgentsExamples
1111
[System.Serializable]
1212
public class BodyPart
1313
{
14-
[Header("Body Part Info")] [Space(10)] public ConfigurableJoint joint;
14+
[Header("Body Part Info")][Space(10)] public ConfigurableJoint joint;
1515
public Rigidbody rb;
1616
[HideInInspector] public Vector3 startingPos;
1717
[HideInInspector] public Quaternion startingRot;

ml-agents-envs/mlagents_envs/registry/binary_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def download_and_extract_zip(
161161
try:
162162
request = urllib.request.urlopen(url, timeout=30)
163163
except urllib.error.HTTPError as e: # type: ignore
164-
e.reason = f"{e.reason} {url}"
164+
e.reason = f"{e.reason} {url}" # type: ignore
165165
raise
166166
zip_size = int(request.headers["content-length"])
167167
zip_file_path = os.path.join(zip_dir, str(uuid.uuid4()) + ".zip")
@@ -217,7 +217,7 @@ def load_remote_manifest(url: str) -> Dict[str, Any]:
217217
try:
218218
request = urllib.request.urlopen(url, timeout=30)
219219
except urllib.error.HTTPError as e: # type: ignore
220-
e.reason = f"{e.reason} {url}"
220+
e.reason = f"{e.reason} {url}" # type: ignore
221221
raise
222222
manifest_path = os.path.join(tmp_dir, str(uuid.uuid4()) + ".yaml")
223223
with open(manifest_path, "wb") as manifest:

ml-agents/mlagents/trainers/tests/torch_entities/test_reward_providers/test_extrinsic.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@ def test_reward(behavior_spec: BehaviorSpec, reward: float) -> None:
7878
# the groupmate rewards.
7979
buffer[BufferKey.GROUP_REWARD] = buffer[BufferKey.ENVIRONMENT_REWARDS]
8080
# 2 agents with identical rewards
81-
buffer[BufferKey.GROUPMATE_REWARDS].set(
81+
data = [
8282
[np.ones(1, dtype=np.float32) * reward] * 2
8383
for _ in range(buffer.num_experiences)
84-
)
84+
]
85+
buffer[BufferKey.GROUPMATE_REWARDS].set(data)
8586
generated_rewards = extrinsic_rp.evaluate(buffer)
8687
assert (generated_rewards == 2 * reward).all()
8788

0 commit comments

Comments
 (0)